Skip to content
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Home Assistant
  4. Force update sensor from HA
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Force update sensor from HA

Scheduled Pinned Locked Moved Home Assistant
2 Posts 2 Posters 2.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • BartB Offline
    BartB Offline
    Bart
    wrote on last edited by
    #1

    Hi,

    I've got a sketch with Button+Relay which can operate independently from the HA (falling edge of button -> toggles relay). The HA can also trigger the change and it is correctly reflected (by switching on/off -> changes relay to on/off). I am also able to read the HA state when the sketch launches so that the state of relay is correctly brought back on sketch startup.

    However I am not sure how should I force update of relay status from HA when it misses some events or HA is off while the sketch is still doing its job. In such case until there's a change triggered by Button or from the HA there is a discrepancy of states (actual vs. shown in HA).

    Is there a way to check these states when HA is starting up. Also I would like to check it periodically to ensure I am in sync.

    Cheers,
    Bart

    martinhjelmareM 1 Reply Last reply
    0
    • BartB Bart

      Hi,

      I've got a sketch with Button+Relay which can operate independently from the HA (falling edge of button -> toggles relay). The HA can also trigger the change and it is correctly reflected (by switching on/off -> changes relay to on/off). I am also able to read the HA state when the sketch launches so that the state of relay is correctly brought back on sketch startup.

      However I am not sure how should I force update of relay status from HA when it misses some events or HA is off while the sketch is still doing its job. In such case until there's a change triggered by Button or from the HA there is a discrepancy of states (actual vs. shown in HA).

      Is there a way to check these states when HA is starting up. Also I would like to check it periodically to ensure I am in sync.

      Cheers,
      Bart

      martinhjelmareM Offline
      martinhjelmareM Offline
      martinhjelmare
      Plugin Developer
      wrote on last edited by
      #2

      @Bart

      Mysensors devices push their updates to home assistant. You can push an update to home assistant at a regular interval. If the state is the same as before in home assistant, a state change won't happen, so it should be harmless.

      For sensors, ie not actuators or binary sensors, I will soon implement forced updates, which mean an update from a sensor device will always force a state change, even if new state is the same as old state. This will enhance recording of sensor values eg when the same value is reported consecutively.

      Regarding syncing state at home assistant start, I think this can be solved for non sleeping devices by using discovery, I_DISCOVER, messages. This is on my todo.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      17

      Online

      11.7k

      Users

      11.2k

      Topics

      113.0k

      Posts


      Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular