Closed rradar closed 5 years ago
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 :question: :grin:
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.
@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!
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? :confused:
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;
}
Couldn't the i
be the the output from another sensor/input? some sort of toggle.. or timer?
@mihalski I thought a timer (for example 15 seconds) would be sufficient for the first working sketch. Any ideas how to implement this?
Isn't i
updated every time the display updates (update_interval
)?
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.
@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.
I was inspired by mqtt-bme280-homie (https://github.com/mhaack/mqtt-bme280-homie/) and wanted to extend it to also work without active wifi/mqtt connection (https://github.com/mhaack/mqtt-bme280-homie/issues/6). What would be the best job for it? For sure esphomeyaml! :sparkles: :sparkler: :fireworks:
Part list:
The total hardware costs are around $5 when ordered directly from the country of origin.
For the font I used five by five licensed under CC BY 4.0 from dafont: https://www.dafont.com/de/fivebyfive.font
And the result looks like this: