Comments (10)
Isn't i
updated every time the display updates (update_interval
)?
from esphome-docs.
Little off topic: the original homie sketch by @mhaack has 4 pages (Temperature, Humidity, etc.) witha very nice layout and a very nice sliding animation/effect while changing the single pages.
Looks a little bit like this and is probably based on homie-display (https://github.com/luebbe/homie-display) from @luebbe
Something like this (more than one page and animations) is not yet possible with esphomeyaml - right β π
from esphome-docs.
Awesome setup! Thanks for sharing!
By cookbook entry I meant creating an entry here: https://esphomelib.com/esphomeyaml/index.html#cookbook π
I will try to convert this guide to the docs format soon, so that other users can profit from this :)
@rradar As for the last post: Yes, more than one page is possible:
display:
- platform: some_platform
lambda: |-
static int i = 1;
if (i == 1) {
// draw first page
i = 1;
} else if (i == 2) {
// draw second page
i = 3;
} else if (i == 3) {
// draw last page
i = 1;
}
but animations: no, at least not easily. As you have direct access to the display (you can draw each pixel individually) it is of course technically possible, although it would not be fun to implement.
Animations would need a major rethink of the display engine. This "draw the entire display from scratch every time" approach is great for quick development, but makes animations difficult. Animations would require a framework where you first add a bunch of widgets at setup time and modify them each frame.
from esphome-docs.
@OttoWinter I'm trying right now to show more than one page (my idea was to switch the pages after n seconds). I'm not sure how to implement this. With your sketch just page one get's shown. What would be the trigger to change the page here?
Herzliches DankeschΓΆn!
from esphome-docs.
Sorry again for asking but how are the pages triggered with this sketch?
display:
- platform: some_platform
lambda: |-
static int i = 1;
if (i == 1) {
// draw first page
i = 1;
} else if (i == 2) {
// draw second page
i = 3;
} else if (i == 3) {
// draw last page
i = 1;
}
It always stays on page 1 for me? π
from esphome-docs.
It always stays on page 1 for me? π
I think you'll need to set i to 2 after drawing the first page - probably a typo.
display:
- platform: some_platform
lambda: |-
static int i = 1;
if (i == 1) {
// draw first page
i = 2; // <-- *here*
} else if (i == 2) {
// draw second page
i = 3;
} else if (i == 3) {
// draw last page
i = 1;
}
from esphome-docs.
Couldn't the i
be the the output from another sensor/input? some sort of toggle.. or timer?
from esphome-docs.
@mihalski
I thought a timer (for example 15 seconds) would be sufficient for the first working sketch. Any ideas how to implement this?
from esphome-docs.
hello
can I make a image change process, conditional weather condition. ?
ex) if 1 then cloudy image, if 2 then sunny image.
I don't know how to make it.
from esphome-docs.
@minsuke You'd need to use some C++ if conditions to do that (I think some of the cookbooks on https://esphome.io may have some examples for that).
Anyway, I'm closing this issue because the cookbook is now on esphome.io - not in the GitHub issue section.
from esphome-docs.
Related Issues (20)
- Build/test in Windows Docker - make: *** No rule to make target 'webserver'. Stop. HOT 4
- Problem with Sonoff TH10 & Si7021 sensor HOT 2
- β οΈ DO NOT POST ISSUES HERE HOT 4
- ESPHome-docs docker image on unraid HOT 1
- Can you add validate button to EDIT window? HOT 1
- Add Skywriter 3D Gesture Sensing Breakout to ESPHome HOT 1
- Feature request: batch upload HOT 1
- Display page change with physical key HOT 1
- Feature Request for docs: add a cookbook for light effects HOT 1
- Wrong indentation in Pulse Counter docs example HOT 1
- BME280 Altitude graph issue HOT 1
- Stepper component typo HOT 1
- cookbook for i2c soil moisture sensor HOT 1
- New integration request: HomeKit BLE HOT 1
- Use a font where 0 and O are perfectly distinguishable HOT 1
- When the router hides the SSID, the device cannot connect to the network? HOT 1
- Configuration for TTGO-Camera Plus HOT 1
- Docker: List of Ports instead of network_mode:host? HOT 1
- ESP32, OLED Display and Deep Sleep HOT 1
- ON INA219 INTERFACE THE SHUNTRESISTANCE IS NOT CORRECT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esphome-docs.