Announcement

Collapse
No announcement yet.

Need Help With HS4 Virtual Devices

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

    Need Help With HS4 Virtual Devices

    Loooong story short, I'm struggling with setting up a HS4 VD to accomplish my goal. (Node-RED to HS4) I'm having 2 issues.

    1) I can't get the look I want for the VD, I simply want to pass data (string) for status, a clean, simple status VD. No matter what I do, I can't duplicate this (I know it's possible see 1st pic below)

    2) I don't know how to pass a string (The string can be any text value, so there is no relation numerically) Sensor Name and Probe Type

    In Node-RED I've tried payload.status and payload.value, neither seem to work as the HS log produces errors:

    payload.status = JSON controldevicebyvalue caused an error: Input string was not in a correct format.
    payload.value = JSON controldevicebyvalue ref 7020 value/label not found

    I've tried, what I believe is every combination I know of and I'm still left with both problems.


    This is what I want it too look like. A Simple, clean status page.
    Click image for larger version

Name:	2021-08-25_17-29-05.png
Views:	285
Size:	73.9 KB
ID:	1491921


    I always end with with this. I don't want the control buttons.
    Click image for larger version

Name:	2021-08-25_17-25-45.png
Views:	240
Size:	110.9 KB
ID:	1491922
    RJ_Make On YouTube

    #2
    Edit the bottom part and don't create anything on top :

    Click image for larger version

Name:	Eman at Work.png
Views:	233
Size:	323.0 KB
ID:	1491925


    Eman.
    TinkerLand : Life's Choices,"No One Size Fits All"

    Comment


      #3
      Thanks but the result is the same: Same errors using payload.status and payload.value as above

      Click image for larger version  Name:	2021-08-27_17-29-26.png Views:	0 Size:	328.0 KB ID:	1491930
      RJ_Make On YouTube

      Comment


        #4
        Click the Edit tool and put something in status (those will be also used in Node-RED to trigger HomeSeer)

        So if that graphic is for Window then put Open



        Click image for larger version  Name:	Status.png Views:	0 Size:	26.3 KB ID:	1491932

        Note : If you devices change values then divide the total accordingly...


        Click image for larger version  Name:	Thermostart.png Views:	0 Size:	127.4 KB ID:	1491935




        Eman
        TinkerLand : Life's Choices,"No One Size Fits All"

        Comment


          #5
          How do I handle a string that is variable? (It could be anything)
          RJ_Make On YouTube

          Comment


            #6
            Originally posted by Eman View Post


            Eman
            Also, if I remove the Control (Top Section of the VD settings) entries for the temperatures (which are all working but I don't want the control boxes to the right) they stop working with the below error.

            JSON controldevicebyvalue ref 7020 value/label not found
            RJ_Make On YouTube

            Comment


              #7
              Originally posted by ServiceXp View Post
              How do I handle a string that is variable? (It could be anything)
              ksum can help with the complex nodes but below is a simple one for a battery device :

              Click image for larger version  Name:	Fuction Node.png Views:	0 Size:	24.1 KB ID:	1491938



              Click image for larger version

Name:	Chahge Node.png
Views:	196
Size:	20.8 KB
ID:	1491971







              Eman.
              TinkerLand : Life's Choices,"No One Size Fits All"

              Comment


                #8
                Originally posted by ServiceXp View Post

                Also, if I remove the Control (Top Section of the VD settings) entries for the temperatures (which are all working but I don't want the control boxes to the right) they stop working with the below error.

                JSON controldevicebyvalue ref 7020 value/label not found
                I have tested this one with a battery device and it worked!
                The values enter the function node then processed and pushed to the change node which then updates the HS Node to Update HomeSeer.


                Click image for larger version  Name:	Battery.png Views:	0 Size:	58.3 KB ID:	1491948





                Eman.
                TinkerLand : Life's Choices,"No One Size Fits All"

                Comment


                  #9
                  Thank You very much Eman, The git-hub information in the other thread was exactly what was needed!!

                  Click image for larger version  Name:	2021-08-28_9-13-04.png Views:	0 Size:	50.2 KB ID:	1492025

                  Click image for larger version  Name:	2021-08-28_9-14-37.png Views:	0 Size:	24.8 KB ID:	1492026
                  RJ_Make On YouTube

                  Comment


                    #10
                    Originally posted by Eman View Post

                    I have tested this one with a battery device and it worked!
                    The values enter the function node then processed and pushed to the change node which then updates the HS Node to Update HomeSeer.


                    Click image for larger version Name:	Battery.png Views:	0 Size:	58.3 KB ID:	1491948





                    Eman.
                    Dude!!! Throw that function node away. It is slower and more resource intensive. Jus tuse a Change node and Move msg.oldPayload to msg.payload (change the Set option to Move) and then Set msg.payload.value to msg.oldPayload.

                    As for the original post issue, for anyone looking here later, I forgot to have the author set msg.topic to Update and we were setting it to Control. Can't control a Status Only device.
                    Karl S
                    HS4Pro on Windows 10
                    1070 Devices
                    56 Z-Wave Nodes
                    104 Events
                    HSTouch Clients: 3 Android, 1 iOS
                    Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

                    Comment


                      #11
                      Originally posted by ksum View Post

                      Dude!!! Throw that function node away. It is slower and more resource intensive. Jus tuse a Change node and Move msg.oldPayload to msg.payload (change the Set option to Move) and then Set msg.payload.value to msg.oldPayload.

                      As for the original post issue, for anyone looking here later, I forgot to have the author set msg.topic to Update and we were setting it to Control. Can't control a Status Only device.
                      ksum ,

                      If I set as per your instructions above the nodes should be as below :

                      Click image for larger version  Name:	MsgObject.png Views:	0 Size:	220.2 KB ID:	1492243

                      Because the message comes in as msg.object, it's not yet processed...unless set the above wrong?

                      Click image for larger version  Name:	oldPlayload.png Views:	0 Size:	141.1 KB ID:	1492244

                      Note : The first part of the Change Node updates the HS Node
                      But... what I did not test and what you did not mention is Move msg.oldPayload.value which I don't think would work either...???


                      Eman.

                      TinkerLand : Life's Choices,"No One Size Fits All"

                      Comment


                        #12
                        Eman get me a complete message debug of what is going into the function node and keys see what we can do.

                        ​​​​
                        Karl S
                        HS4Pro on Windows 10
                        1070 Devices
                        56 Z-Wave Nodes
                        104 Events
                        HSTouch Clients: 3 Android, 1 iOS
                        Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

                        Comment


                          #13
                          Originally posted by ksum View Post
                          Eman get me a complete message debug of what is going into the function node and keys see what we can do.

                          ​​​​
                          I will get back to you on this one. Right now am mobile.


                          Eman.
                          TinkerLand : Life's Choices,"No One Size Fits All"

                          Comment


                            #14
                            ksum ,

                            Image below I have removed the function node and it looks like the value (string) has already been processed...


                            Click image for larger version  Name:	ioBroker Node.png Views:	0 Size:	28.5 KB ID:	1492436





                            Click image for larger version  Name:	Message Payload.png Views:	0 Size:	96.5 KB ID:	1492433

                            So in order to update the HS node would seem something simple like set the msg.payload to update but that does work neither does set the msg.topic to update...???

                            I get no errors when I push it but the virtual device doesn't update. Image below


                            Click image for larger version  Name:	Message Topic.png Views:	0 Size:	54.7 KB ID:	1492434




                            Click image for larger version

Name:	Owntracks.png
Views:	124
Size:	98.3 KB
ID:	1492481






                            Eman.
                            TinkerLand : Life's Choices,"No One Size Fits All"

                            Comment


                              #15
                              Eman I believe you are forgetting that the HomeSeer node needs either msg.payload.status or msg.payload.value set to control the device. So you need to set one and also set the topic. For your two scenarios, you have these options:

                              In your first scenario, where the desired value is saved to msg.payload, we need to first Move msg.payload. This is because the current msg.payload is not an object and HomeSeer needs it to be an object so se can set the status key. So we Moce it to msg.oldPaylaod and then we Set msg.payload.status to msg.oldPayload:
                              Click image for larger version

Name:	HS1.png
Views:	135
Size:	21.4 KB
ID:	1492536




                              Scenario 2 uses your Object output. Since msg.payload is already an Object, we don't have to Move it, we can just set msg.payload.status, as shown below. HomeSeer will ignore the items it doesn't know about.
                              Click image for larger version

Name:	HS2.png
Views:	123
Size:	13.8 KB
ID:	1492537



                              Karl S
                              HS4Pro on Windows 10
                              1070 Devices
                              56 Z-Wave Nodes
                              104 Events
                              HSTouch Clients: 3 Android, 1 iOS
                              Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

                              Comment

                              Working...
                              X