MallocArray / airgradient_esphome

ESPHome definition for an AirGradient DIY device to send data to HomeAssistant and AirGradient servers
GNU General Public License v3.0
247 stars 43 forks source link

Can you add a display*.yml option to display the time please? #62

Closed letshin closed 2 months ago

letshin commented 6 months ago

I think it would be useful for the airgradient to show the current time. Could you add a version displaying time please?

MallocArray commented 5 months ago

I'll look at it, but not sure where it would fit into the standard AirGradient display page. So it may need its own page

Adding the time option could have implications on memory usage that I would have to monitor.

So it will be on the list to look at, but not saying it will be soon.

letshin commented 5 months ago

Understood - perhaps an option to display text through a MQTT call then? That way users can add in what they want themselves on node red etc.

MallocArray commented 5 months ago

I don't know how that would be accomplished, but if you figure something out, it can be considered as a new package that people could choose to add. I haven't added the MQTT components to ESPHome and not sure of the impact to RAM and flash space, and not sure how to accept data that would then go into a page for the display.

letshin commented 5 months ago

Got this working on an eink display so should be similar, not sure if it will work with airgradient yet as I haven't found time for that yet:

time:
  - platform: homeassistant
    id: homeassistant_time

text_sensor:
  - platform: template
    name: "Current Time"
    id: current_time
    update_interval: 10s
    lambda: return  id(homeassistant_time).now().strftime("%H%M");

display:
  - platform: waveshare_epaper
    id: eink_display
    ### truncated
    lambda: |-
      it.printf(240, 490, id(font3), TextAlign::TOP_CENTER, "%s", id(current_time).state.c_str());
MallocArray commented 2 months ago

If someone else comes up with a complete file for it, it can be added as an optional package, but not on my list to work on at this time.