Baldhor / Homey-ESPhome-Enhanced

This is an Homey app which adds support for ESPHome devices. ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems. More information on their homepage: https://www.esphome.io/
GNU General Public License v3.0
4 stars 3 forks source link

Option to force update sensor values #14

Closed OneGoogus closed 10 months ago

OneGoogus commented 10 months ago

Hi Baldhor

Would it be possible to make an option in settings on the device to update values every so often? Like this: image

its becouse I post a line every day in a Google Sheet on devices with no communication the last 24 hours. And the esp device is the only thing jumping on it becouse values have been the same the past 3 days. image

Baldhor commented 10 months ago

@OneGoogus For me the best would be to force publish from the device itself.

Add this to your sensor configuration:

    filters:
      - timeout: 24h

Your device will send a nan value if there was no update for 24h. However to be honest I don't think Homey app will appreciate a NAN value :)

Another solution is to use a timer, and periodically send the current value.

time:
  - platform: sntp
    # ...
    on_time:
      # Every morning at 7am
      - seconds: 0
        minutes: 0
        hours: 7
        then:
          - lambda: !lambda |-
            id(<yourdeviceid>).internal_send_state_to_frontend(id(<yourdeviceid>.state);

I'm 99% sure this solution will work as long as you fix the syntax errors (if any) => untested

Baldhor commented 10 months ago

@OneGoogus Any news about this subject?

Baldhor commented 10 months ago

no news, closing