Announcement

Collapse
No announcement yet.

How to insure virtual device status is restored after restart?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to insure virtual device status is restored after restart?

    I have created a couple of simple virtual devices in my HS3 setup. They both have a few possible statuses, Home/Away/InBed, but one of them is getting its status restored after startup and the other isn't but I don't see any difference in how they were defined so it must be a difference in how their values are set. The one that is getting restored is set manually by a user using HSTouch, whereas the one that's not getting restored is set via an event (it is an internal status that gets set after a timer elapses). I read a post saying to call hs.SaveEventsDevices from a script, but I don't have any scripts and don't know how to create them. I just have devices and events.

    Any suggestions? Thanks.
    Ken

    #2
    I'd like to know the answer to this one myself. Every time I have to restart my systems all of my device status data reverts to a period 7-10 days old.

    Comment


      #3
      Is the shutdown orderly? HS should be storing the device state continually, so that on restart the devices would have the same state they had at shutdown. If you have power fail recovery enabled, then any devices and events that are included ought to be updated based on events that were missed while the program was not running.

      If your device states change after a restart, especially if they revert to an earlier time, then I would suspect there is a problem with your database write process.

      Does the date modified column have the current date and time next to the 'HomeSeerData.hsd' file?
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #4
        The restart was orderly in this test, in that I logged into the Raspberry Pi and typed 'sudo reboot'. Was Homeseer alerted of imminent shutdown and given a chance to write anything to disk? I doubt it, but I guess it depends on how HomeSeer was written and how it registered itself with Raspbian to restart automatically. I haven't touched any of this - it is the standard distribution of HS3 on the Rpi.

        But I checked before rebooting today, and found that my HomeSeerData.hsd file had not been updated since yesterday (the last time I did a reboot), even though I have updated these virtual device states today.

        Should it matter how my system was restarted? I do have my RPi plugged into a UPS, but my UPS is not communicating with the RPi so when the battery runs out it's going down.

        What's the solution? I need some way to tell HS3 to write state changes out to disk, so it is prepared before the system shuts down in a disorderly way.

        If the only solution is to write a script and invoke it from my timer event, then I'll learn how to write scripts for HS3.

        Thanks
        Ken

        Comment


          #5
          I doubt if many linux programs would save db and orderly shutdown given the os was told reboot......os will just inform stuff it's going down and program will exit quickly, closing db to avoid corruption.
          HS3 Pro Edition 3.0.0.435 (Windows 10 vmware)
          BLOccupied:,UltraNetCam3:,weatherXML:,RFXCOM:,Current Cost 3P:,UltraGCIR3:
          DMMQTT:,Kodi:,Z-Wave:,BLRadar:,EasyTrigger:,MySensors:,BLBackup:

          Comment


            #6
            Originally posted by kvancamp View Post
            The restart was orderly in this test, in that I logged into the Raspberry Pi and typed 'sudo reboot'. Was Homeseer alerted of imminent shutdown and given a chance to write anything to disk? I doubt it, but I guess it depends on how HomeSeer was written and how it registered itself with Raspbian to restart automatically. I haven't touched any of this - it is the standard distribution of HS3 on the Rpi.

            But I checked before rebooting today, and found that my HomeSeerData.hsd file had not been updated since yesterday (the last time I did a reboot), even though I have updated these virtual device states today.

            Should it matter how my system was restarted? I do have my RPi plugged into a UPS, but my UPS is not communicating with the RPi so when the battery runs out it's going down.

            What's the solution? I need some way to tell HS3 to write state changes out to disk, so it is prepared before the system shuts down in a disorderly way.

            If the only solution is to write a script and invoke it from my timer event, then I'll learn how to write scripts for HS3.

            Thanks
            Ken
            You don't need a full script:

            Click image for larger version

Name:	Capture.jpg
Views:	1
Size:	16.4 KB
ID:	1187948

            However something else has to be wrong as HS should be writing to it regularly. I would try a repair of mono. I've experienced similar issues on Windows XP where a .net repair resolved it.

            Cheers
            Al
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #7
              You're right, I tried invoking hs.SaveEventsDevices and it didn't change anything. Can you point me to any instructions on how to repair Mono?

              Thanks
              Ken

              Comment


                #8
                Originally posted by kvancamp View Post
                You're right, I tried invoking hs.SaveEventsDevices and it didn't change anything. Can you point me to any instructions on how to repair Mono?

                Thanks
                Ken
                Hi Ken, one of the linux gurus will need to jump in as I'm more of a Windows guy. There should be some examples on the board as well (try searching the board using Google by including site:board.homeseer.com in the search). Also make sure to install the same version of mono as there are issues going from mono 3 to 4 and vice versa.

                Cheers
                Al
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #9
                  A few more thoughts:

                  - Do you get any errors in the HS log when you issued the save command?
                  - Check the setup page to confirm it has the same file that you are expecting.
                  - Maybe there's an issue with the SD card. Do you have another one that you could restore to?
                  HS 4.2.8.0: 2134 Devices 1252 Events
                  Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                  Comment


                    #10
                    Actually, checking the log was a good suggestion because I realized that I had mis-typed the command and an error was being reported when I tried to do hs.SaveEventsDevices. After correcting, I find this is now working. The state of my virtual device is now being saved. Problem solved!

                    Thank you!

                    Comment


                      #11
                      I save same issue with some virtual devices not keeping state. My luck one of them is "night"

                      Sent from my SAMSUNG-SM-G890A using Tapatalk

                      Comment


                        #12
                        Originally posted by kvancamp View Post
                        Actually, checking the log was a good suggestion because I realized that I had mis-typed the command and an error was being reported when I tried to do hs.SaveEventsDevices. After correcting, I find this is now working. The state of my virtual device is now being saved. Problem solved!

                        Thank you!
                        You're welcome. I still suspect something is wrong as HS should be saving things automatically and frequently.

                        Cheers
                        Al
                        HS 4.2.8.0: 2134 Devices 1252 Events
                        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                        Comment


                          #13
                          Originally posted by sparkman View Post
                          You don't need a full script:

                          [ATTACH]57884[/ATTACH]

                          However something else has to be wrong as HS should be writing to it regularly. I would try a repair of mono. I've experienced similar issues on Windows XP where a .net repair resolved it.

                          Cheers
                          Al
                          Tried the script on mine, and it retained the current information after the reboot. I imagine I have the same problem with Mono, but I am a little gunshy about some major tinkering to a production system that has been working pretty well of late. I think I will just have it trigger the event every hour or so and call it good until HS moves over to Mono 4.x.

                          Comment

                          Working...
                          X