Announcement

Collapse
No announcement yet.

Virtual device toggle

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

    Virtual device toggle

    Hello,

    On my HStouch client I have a button HS device Lamp.
    I can toggle the lamp on and off. (action when released command : toggle on/off)
    Next the button is the status of the device (status text On/Off)
    Also the Status collors (black off) and red (on). works fine for me.

    But when I want to do the just the same for an other device it dus not work.
    I can NOT give the action when released command : toggle on/off.
    I only can give the action when released command : toggle.

    What can be the problem?
    renaatdb

    #2
    Virtual devices do not have on/off toggles. Is this a real device you are controlling or a virtual device?
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Master Bedroom Wake-up Alarm V10 Virtual
      It is virtual
      sub main()
      A script sets the device on and off

      If hs.DeviceStatus("v10") = 3 Then
      hs.SetDeviceString "v10","0n"
      hs.SetDeviceStatus "v10","2"
      else
      hs.SetDeviceString "v10","0ff"
      hs.SetDeviceStatus "v10","3"
      end if

      Alarm clock screen from
      http://board.homeseer.com/showthread...=132231&page=3

      renaatdb

      Comment


        #4
        Originally posted by Rupp View Post
        Virtual devices do not have on/off toggles. Is this a real device you are controlling or a virtual device?
        Actually, that depends on whether or not the type is defined as "Status Only" or not. If it is, it is possible to set the status from within HS using a script, but it's quite likely HST wouldn't know anything about setting the device On/Off. I wouldn't consider that a bug - rather perhaps a deficiency.
        Real courage is not securing your Wi-Fi network.

        Comment


          #5
          I would recommend changing the virtual device type to a lamp module and try that.
          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

          Comment


            #6
            changing the virtual device type to a lamp module is not working
            renaatdb

            Comment


              #7
              If you add a virtual devices to a room in HS you can then toggle on / off in HSTouch. I us it all the time for auto manual of virtual flags to mark if something has be set in an event.

              Comment


                #8
                If you add a virtual devices to a room in HS you can then toggle on / off in HSTouch?
                I do not understand.
                sorry
                renaatdb

                Comment


                  #9
                  I have virtual devices that have on/offs without a problem, I too use them to flag things (like disabling motion events) as I find it makes more sense in the events page to have a "House Holiday Mode Is Off" vs. "House Holiday Mode equals value 0". The former for a casual outsider makes more sense as to what it actually does.

                  Anyway, back to the main thing. I really recommend not setting the device string to "On" and "Off" and there is no actual need to do it. If you create another device with the type virtual and use hs.setdevicestatus("V10", 3) or hs.setdevicestatus("V10", 3) you should see that On/Off is updated in the device string correctly without the need to set the string itself.

                  Once you do set the device string to something (even if it is On/Off) it never returns back to normal.

                  I would say it probably is actually changing the status but because you have set the device string it might not be quite working as expected, when you toggle the device in HSTouch run this command for both times you toggle it

                  hs.writelog("", hs.devicestatus("V10"))

                  You might probably find it changes from 2/3 as it needs to.

                  I would delete your virtual device and do this

                  If hs.DeviceStatus("v10") = 3 Then
                  hs.SetDeviceStatus "v10", 2
                  else
                  hs.SetDeviceStatus "v10", 3
                  end if

                  And see if it works

                  Comment


                    #10
                    Sorry I don't see the picture..

                    Comment


                      #11
                      Sorry there is no picture on my post. Actually I am not sure of what the script is for, all I was saying is don't touch the strings if you want a device to be on/off and you want it to stay that way in the devices page.

                      What exactly do you mean when you say they don't work?

                      Comment


                        #12
                        Rupp recommended changing the virtual device type to a lamp module
                        My problem
                        On my HStouch client I have a button HS device Lamp.
                        I can toggle the lamp on and off. (action when released command : toggle on/off)
                        beside the button I have a text box wich give the status of the device (status text On/Off)
                        Also the Status collors (black off) and red (on). works fine for me.

                        But when I want to do the just the same for an other device it dus not work.
                        I can NOT give the action when released command : toggle on/off.
                        I only can give the action when released command : toggle.

                        Sorry for my stupidity
                        The toggle alarm script is included
                        I get the Alarm clock screen from
                        http://board.homeseer.com/showthread...=132231&page=3

                        Renaatdb
                        Attached Files

                        Comment


                          #13
                          So toggle an virtual device on/off is not possible in HS touch design?

                          What is the best way to change say "Guest" from Active to Inactive with 1 button if possible?

                          I could do it easy and just make 2 buttons but it would not look any good.
                          Certified installer for HomeSeer, Control4, KNX and Eaton/xComfort

                          Comment


                            #14
                            Originally posted by renaatdb View Post
                            Master Bedroom Wake-up Alarm V10 Virtual
                            It is virtual
                            sub main()
                            A script sets the device on and off

                            If hs.DeviceStatus("v10") = 3 Then
                            hs.SetDeviceString "v10","0n"
                            hs.SetDeviceStatus "v10","2"
                            else
                            hs.SetDeviceString "v10","0ff"
                            hs.SetDeviceStatus "v10","3"
                            end if

                            Alarm clock screen from
                            http://board.homeseer.com/showthread...=132231&page=3

                            renaatdb
                            I'm assuming this is HS2.

                            I do this routinely using an event. That is, a button press (or release) executes an HS event.

                            The event action is an immediate script:
                            &If hs.IsOFF ("V10") Then : hs.Transmit "V10", "ON" : Else : hs.Transmit "V10", "OFF"
                            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


                              #15
                              Im not sure how i use these stuff. its like greek to me.

                              What iv done for now is to use a picure with on/off on it. then having that picture follow the state, and then on top of this i have 2 transparent buttons that will work as on/off. Seems to work actually. Though it is a bit of a struggle working with.
                              Last edited by U5tabil; January 22, 2015, 03:00 PM.
                              Certified installer for HomeSeer, Control4, KNX and Eaton/xComfort

                              Comment

                              Working...
                              X