Skip to content
  • MySensors
  • 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. Heartbeats

Heartbeats

Scheduled Pinned Locked Moved Home Assistant
23 Posts 6 Posters 7.8k Views 6 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.
  • dpressleD dpressle

    @iLusion i am just trying to help here so i hope no one is med about me for saying what i have to say and where i have to say it :smiley:
    So i am thinking out load here, if you want to send heartbeat and assuming your node is time sleeping (not interrupt) otherwise how would you send heartbeat right? why dont you send your current status (even if its not changed) so HA will be updated as i suggested before.

    I mean , unless i missed something here, whats the difference between heartbeat and sending the status??? they both use radio and node needs to be awake...

    iLusionI Offline
    iLusionI Offline
    iLusion
    wrote on last edited by
    #14

    @dpressle ofcourse! I appreciate your help and I am sure, so does anyone who'd benefit from this thread. This is the power of open source and community supported projects! :smiley:

    Sending the same state over and over again won't be ideal. Here is why -

    Assumptions

    1. Node is not interrupt driven

    Scenario

    1. Loop 0 - Door closed, send state Door close as of T
    2. Loop 1 - Door open, send state Door open as of T+1
    3. Loop 2 - Door open, send state Door open as of T+2

    Now, the door was actually, open at T+1, if HA processes, force updates then HA would show that door is open as of T+2 - We cannot now determine that the door was actually open since T+1 as oppose to T+2.

    Hope this helps.

    1 Reply Last reply
    0
    • martinhjelmareM Offline
      martinhjelmareM Offline
      martinhjelmare
      Plugin Developer
      wrote on last edited by martinhjelmare
      #15

      I think forced updates should only be used for pure sensor types. Using it for binary sensors is not a good solution, as mentioned.

      The built in last changed time report in home assistant is only applied when the state is changed, so will not come in play in cases when the state is not changed even though a device sent an update. Using forced updates circumvents this, but as said is not a good solution in all cases.

      We could report heartbeats as a regular sensor value which could then be checked in an automation/script. A problem might be what sensor ID to use, cause the heartbeat is for the node, not only for a sensor. I'll think about this.

      iLusionI 1 Reply Last reply
      0
      • martinhjelmareM martinhjelmare

        I think forced updates should only be used for pure sensor types. Using it for binary sensors is not a good solution, as mentioned.

        The built in last changed time report in home assistant is only applied when the state is changed, so will not come in play in cases when the state is not changed even though a device sent an update. Using forced updates circumvents this, but as said is not a good solution in all cases.

        We could report heartbeats as a regular sensor value which could then be checked in an automation/script. A problem might be what sensor ID to use, cause the heartbeat is for the node, not only for a sensor. I'll think about this.

        iLusionI Offline
        iLusionI Offline
        iLusion
        wrote on last edited by
        #16

        @martinhjelmare

        The NodeID could be the least common denominator here, I'd think.

        1 Reply Last reply
        0
        • martinhjelmareM Offline
          martinhjelmareM Offline
          martinhjelmare
          Plugin Developer
          wrote on last edited by
          #17

          No, each entity needs node and child ID. Another option would be to report heartbeat as a state attribute for all children of a node. But I have to look into how that would affect last changed/updated time stamps and if there's a difference between state and state attributes in this context.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koen01
            wrote on last edited by
            #18

            @martinhjelmare
            Any new developments regarding this topic?

            martinhjelmareM 1 Reply Last reply
            0
            • K koen01

              @martinhjelmare
              Any new developments regarding this topic?

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

              @koen01

              No, but it's on my todo list. PR is also welcome.

              1 Reply Last reply
              0
              • flyswiftlyF Offline
                flyswiftlyF Offline
                flyswiftly
                wrote on last edited by
                #20

                I wonder if a 'virtual child' of the sensor might be a solution? Just define a second child of the node that periodically sends the opposite status. It would simply be defined in the sketch on the sensor, not tied to actual hardware. First interval, it sends 'true' or 'open' or 1, next interval it sends 'false' or 'closed' or 0. Since it's programmed to change every interval, looking at the last update of the virtual child will let you know the sensor is functional or not.

                martinhjelmareM 1 Reply Last reply
                0
                • flyswiftlyF flyswiftly

                  I wonder if a 'virtual child' of the sensor might be a solution? Just define a second child of the node that periodically sends the opposite status. It would simply be defined in the sketch on the sensor, not tied to actual hardware. First interval, it sends 'true' or 'open' or 1, next interval it sends 'false' or 'closed' or 0. Since it's programmed to change every interval, looking at the last update of the virtual child will let you know the sensor is functional or not.

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

                  @flyswiftly

                  Yes, this is already possible today. Downside is that the user has to keep track of what other sensors (entities) this information applies to. The node_id is available among the state attributes so that will be a help.

                  1 Reply Last reply
                  0
                  • flyswiftlyF Offline
                    flyswiftlyF Offline
                    flyswiftly
                    wrote on last edited by
                    #22

                    Seems the node id would server that tracking need.

                    1 Reply Last reply
                    0
                    • martinhjelmareM Offline
                      martinhjelmareM Offline
                      martinhjelmare
                      Plugin Developer
                      wrote on last edited by
                      #23

                      Yes, with some imagination, you could probably make a template that would match the correct criteria, and use eg for a notification.

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


                      10

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 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
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular