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. Domoticz
  4. Forcing a status updated when sensor value has not changed

Forcing a status updated when sensor value has not changed

Scheduled Pinned Locked Moved Domoticz
9 Posts 4 Posters 5.9k Views 3 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.
  • M Offline
    M Offline
    malarcy
    wrote on last edited by
    #1

    Hi - have discussed this over on Domoticz forum, but I guess it's best placed here.

    I would like to use a "fake" sensor from a mysensors node to domoticz to indicate that a particular sensor that has "real" sensors is still alive - the sensors won't change often but I want to know that everything is well - the plan is have three "switches" presented - two linked to rea external sensors - the other, no physical device attached - I wait in the loop for interrupt on either switch and also for a timeout - when I wake - I check switch state - if changed - send update - and also send "on" to the dummy sensor .

    this i hoped would make domoticz update its last seen time - but it doesn't - if the switch state does not chnage then the update is ignored - i have confirmed this by modyfying mysensorsbase.cpp to take out the "don't update if nothing changed code".

    my question/suggestion is perhaps we should update last seen time - even if we don't actually update the status of the switch (although I have a use case for updating even if value the same)

    would like to hear what others think.

    1 Reply Last reply
    1
    • sundberg84S Offline
      sundberg84S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by
      #2

      I have allready requested the sendheartbeat() thats included from 1.6.0b to be implemented, but at this moment im having a hard time to convice Gimzocus... my suggestion was that this would update "last seen" without updating the value.

      If you think its a good idea you could send a +1 on my post or something.

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      1 Reply Last reply
      1
      • M Offline
        M Offline
        malarcy
        wrote on last edited by
        #3

        Have added my request to yours - however, I am not sure who "owns" the code for the mysensors "hardware" for domoticz - in my thread I detail the hack I did to the mysensorsbase.cpp file to make it always update a switch when requested - even if the value has not changed - in my case - this gives me the ability to add a "heartbeat" sensor to any node and update it from the sketch - not as neat as having sendheartbeat supported - but it works for me - but having to make that change every time i update domoticz is a pain. (https://www.domoticz.com/forum/viewtopic.php?f=42&t=9272)

        Although nobody has said "its not up to me" - nobody has said - "it works like that for a reason" - I think the change for this would need to come in the mysensorsbase code set - and whilst that is shipped with domoticz - I don't know who actually wrote it - Gimzocus kind of suggested that "it had probably been coded a certain way" - that sounded like he wasn't looking after the code - but I might be wrong on that.

        1 Reply Last reply
        0
        • sundberg84S Offline
          sundberg84S Offline
          sundberg84
          Hardware Contributor
          wrote on last edited by
          #4

          No clue, but its on github so if you have a fix you could make a pull request...

          Controller: Proxmox VM - Home Assistant
          MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
          MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
          RFLink GW - Arduino Mega + RFLink Shield, 433mhz

          1 Reply Last reply
          0
          • M Offline
            M Offline
            malarcy
            wrote on last edited by
            #5

            I thought about doing that - but the point is it is coded specifically to behave in the "no update" way - my change isn't a fix but a reversal of some deliberate logic - so if I change it - "someone" might just change it back - the best way would be to implement it as a configuration option - but that is a lot more work that my "dirty hack" of chopping out the checking code.

            I will take another look when the 1.6 code is released and see when the options are then.

            1 Reply Last reply
            0
            • mfalkviddM Online
              mfalkviddM Online
              mfalkvidd
              Mod
              wrote on last edited by
              #6

              @malarcy could you post which line(s) you changed in hardware/MySensorsBase.cpp ?

              1 Reply Last reply
              0
              • mfalkviddM Online
                mfalkviddM Online
                mfalkvidd
                Mod
                wrote on last edited by mfalkvidd
                #7

                Never mind, found it in https://www.domoticz.com/forum/viewtopic.php?f=42&t=9272#p64978

                I think the best is to just make a pull request to remove the check.

                The comment doesn't say why "last seen" shouldn't be updated. The commit message (b8771dbdaf98eb6f82e23058d4e8f3b9cbe94f68) doesn't say why "last seen" shouldn't be updated. So it seems to just be a simple mistake.

                Building a new feature to get around a bug is usually a bad idea. It is confusing for users, who read the UI and think "last seen" actually means "last seen". It is confusing for developers, who need to somehow learn to use the new feature to get the behavior they expect. And it will trip up the existing feature in Domoticz that marks widgets in red if they haven't been seen for a while.

                1 Reply Last reply
                0
                • sundberg84S Offline
                  sundberg84S Offline
                  sundberg84
                  Hardware Contributor
                  wrote on last edited by
                  #8

                  sendHeartBeat() has now been implemented in Domoticz :)
                  http://www.domoticz.com/forum/viewtopic.php?f=42&t=9775&p=75250#p75250

                  Controller: Proxmox VM - Home Assistant
                  MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
                  MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
                  RFLink GW - Arduino Mega + RFLink Shield, 433mhz

                  Boots33B 1 Reply Last reply
                  1
                  • sundberg84S sundberg84

                    sendHeartBeat() has now been implemented in Domoticz :)
                    http://www.domoticz.com/forum/viewtopic.php?f=42&t=9775&p=75250#p75250

                    Boots33B Offline
                    Boots33B Offline
                    Boots33
                    Hero Member
                    wrote on last edited by
                    #9

                    @sundberg84 Is there any trick to get this to work in Domoticz ?

                    I have just added a heartbeat to one of my sketches and I don't see any changes in the last seen time for that node in Domoticz.

                    The serial monitor for the node reports the heartbeat is sent

                    TSP:SANCHK:OK
                    TSP:MSG:SEND 8-8-0-0 s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=ok:1258134
                    Heartbeat Sent
                    

                    But I get nothing in Domoticz, should I see it in the log file?

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


                    11

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