Announcement

Collapse
No announcement yet.

How Do I Clear a Device's Status

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

    How Do I Clear a Device's Status

    I'm feeling kind of dumb here since I can't do something that seems simple. I have a virtual device with a feature that shows the value (0/1) of a Pi GPIO pin. It's set using Node-RED. I have 2x Status Graphics set, one fo '0' and another for '1'. The graphics are On and Off and the Status is 'Low' and 'High'. I accidentally set the device value and device status to '0' and now the Web UI always shows '0' and not Low nor High.

    How do I clear the device status so it's works as it did previously?

    #2
    It would still be nice to know how to do this either with the Web UI or with a script but I was able to do it from Node-RED by forcing a status update with the status set to a blank string.

    Comment


      #3
      That sounds like you made a change on the status graphics page.
      You can set a feature to use a status string or an image in place of a value.
      Wade

      sigpic

      website | products | support | youtube
      I know nothing...., nothing!!!

      Comment


        #4
        Originally posted by kenm View Post
        It would still be nice to know how to do this either with the Web UI or with a script but I was able to do it from Node-RED by forcing a status update with the status set to a blank string.
        Run this from tools/script commands:

        &hs.SetDeviceString(1234, " ", False)

        1234 is the deviceID


        ---
        John

        Comment


          #5
          Sgt. Shultz I did it from Node-RED. Thanks John245 There used to be hs.SetDeviceStatus and hs.SetDeviceString and they did different things. Now, it appears the device string is the status? Is that the case?

          Comment


            #6
            I don't remember offhand.
            That would be something to look at in the docs (maybe for plugins?)
            Wade

            sigpic

            website | products | support | youtube
            I know nothing...., nothing!!!

            Comment


              #7
              Create an Event, then Enable "Advance Options", then in the Status of the Device Event, enter in: CLEAR

              Then run the event, this will "Clear" any hard coded Status you have

              Comment


                #8
                Originally posted by OmegaQuest View Post
                Create an Event, then Enable "Advance Options", then in the Status of the Device Event, enter in: CLEAR

                Then run the event, this will "Clear" any hard coded Status you have
                Thanks. I'll give that a try.

                Comment


                  #9
                  Originally posted by kenm View Post
                  Sgt. Shultz I did it from Node-RED. Thanks John245 There used to be hs.SetDeviceStatus and hs.SetDeviceString and they did different things. Now, it appears the device string is the status? Is that the case?
                  The Device Status is the string associated with the device's current status value. The Device String is any random string you (or something) decided to put onto the device. The Device string is what will be displayed, until the device string is erased (and then the Device Value string will re-appear).

                  Which is why "&hs.SetDeviceString(1234, "", False)" will work to put back that device value string.

                  Comment


                    #10
                    David has it about correct above. There are three variables affiliated with a HomeSeer Device:
                    • Value = the numerical value assigned to a device. This is always a numerical value, usually an integer, but can have can have decimal precision. The Value is what HomeSeer looks at for Triggering and is what is set when a Device is controlled.
                    • Status = this is a text string that is assigned to a single value. A Status can only be assigned to a single value, it cannot be applied to a range. The Status is a means of providing a more user friendly interface for controlling Devices or using the value in a Trigger or Condition. For example a typical HS Virtual Device will have Off with a value of 0 and On with a value of 100. If you set the device to "On" in an event, it will display "On" as text and set the Value to 100. You can do the same thing by setting the Value to 100, which in turn will cause the "On" text to display as the status. Again, HomeSeer only looks to the Value, the Status is just a human friendly mechanism. For display of a value within a range of values, the status will be created by the settings in StatusGraphics. These settings can prepend or append the value, set the number of decimal places and whether to include the value or not.
                    • String = A means of displaying text as the Status of the device. If the String is set, it will replace the Status and the actual Status of the device will NOT be displayed. String is very useful in that it can be populated with almost anything including HTML and graphics. HomeSeer does not look at the String for triggering, but Spud's Easy Trigger can.
                    While I wrote this for HS3, the Device Structure is almost identical in HS4. This could give a broader understanding of how HomeSeer Devices are structured and how they function. As I find time I will update this thread for HS4, though HS4 has some limitations to setting a Device as compared to HS3. One big difference is that there is no way to clear a String within an Event and the String is not a separate item displayed within the device. If the String is set, it will show under Status in the Device's Advanced information.

                    Here are a couple of screenshots of the same HS4 device, the first is from the HS4 "Legacy" Device manager and the second is the new GUI version. In the Legacy HS3 version, you can see that all three (Value, Status and String) are displayed. As you can see I have loaded "Hello World" as the String. The Legacy display clearly shows the status of the device as Off.

                    Click image for larger version  Name:	HS3Advanced.png Views:	0 Size:	40.0 KB ID:	1549991
                    In the HS4 interface, the String is no longer called out. Instead "Hello World" is shown as the Status. The actual Status is Off. While there is a difference in how Devices are displayed, it is important to note that the three fields are separate and distinct and if there is something stored in the String, the Status will not display.

                    Click image for larger version  Name:	HS4Advanced.png Views:	0 Size:	74.6 KB ID:	1549992

                    When the Device is shown, since the String is set, "Hello World" will display as the Status. It doesn't matter whether the Device is On or Off, it will always display the String. The Status and Value of the device can still be controlled and the correct graphic will be displayed, but the Status will not.

                    Click image for larger version  Name:	capture.png Views:	0 Size:	15.7 KB ID:	1549993

                    In order for the device to return to displaying the Status, the string must be cleared. In HS3 you had he option to clear the String within an Event Action. HS4 no longer provides that option, so you must run an immediate script to clear it. For device 2361 above I ran this command from an immediate script &hs.SetDeviceString(2361, "", False). This results in the device returning to normal Status display.

                    Click image for larger version  Name:	capture1.png Views:	0 Size:	14.8 KB ID:	1549994
                    Here is an example of how the String can be used. Remember for all intents and purposes it is a display only value. This is from Jon00's Performance Monitor. Jon loads text and an image for display.

                    Click image for larger version  Name:	capture2.png Views:	0 Size:	11.6 KB ID:	1549995

                    As you can see, Jon uses a numerical value for CPU usage to plug into the Value field so that the Device can be used for Triggers and/or conditions, but the String display is for the User to look at.

                    Click image for larger version  Name:	capture3.png Views:	0 Size:	72.5 KB ID:	1549996

                    Comment


                      #11
                      Randy,

                      In HS3, " " is considered a one character string, and will simply replace the device string with that one blank character. "" is considered a null string, and will properly erase the device string so that the device value string will reappear. Has this been changed in HS4?

                      Comment


                        #12
                        Originally posted by aa6vh View Post
                        Randy,

                        In HS3, " " is considered a one character string, and will simply replace the device string with that one blank character. "" is considered a null string, and will properly erase the device string so that the device value string will reappear. Has this been changed in HS4?
                        It was a typo on my part, should have been “”, but either will work in HS since leading spaces are trimmed. You could use a dozen space characters and the String would still be blank as far as HS is concerned. This is HS4 and I just tested to confirm. I believe HS3 was the same.

                        Fixed the earlier post.

                        Comment


                          #13
                          Thanks, randy, that was an excellent explanation.
                          HomeSeer Version: HS3 Pro Edition 4.2.6.0
                          Operating System: Microsoft Windows 10 Pro - Desktop

                          Enabled Plug-Ins
                          AK Google Calendar 3.0.0.45,AK Smart Device 3.0.0.6,AK Weather 4.0.1.77,AmbientWeather 3.0.1.9,Big5 1.38.0.0,BLBackup 2.0.63.0,BLGData 3.0.55.0,BLLock 3.0.38.0,BLPlex 2.0.22.0,BLUPS 2.0.26.0,Device History 3.2.0.2,EasyTrigger 3.0.0.74,HSBuddy 3.25.614.1,mcsMQTT 5.21.4.1,MeiHarmonyHub 3.1.0.22,NetCAM 3.0.0.14,PHLocation 3.0.1.109,Restart 1.0.0.7,SDJ-Health 3.1.0.3,SDJ-VStat 3.1.0.7,TPLinkSmartHome 19.10.7.1,UltraCID3 3.0.6681.34300,UltraSighthoundVideo3 3.0.5960.36744,,Z-Wave 3.0.2.0

                          Comment

                          Working...
                          X