Announcement

Collapse
No announcement yet.

Keeping a Node-Red Dashboard in sync with HomeSeer

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    I used it as a test to see if I wanted to replace any of the other options available for a phone and possible dedicated tablet interface. Here are shots from my phone with the Basement group closed. On a tablet or computer screen these layout different. Basically each Group goes where it fits. As a result I found the Dashboard to be less interesting to me but I do find the flow to be a good study in various Node Red programming methods.

    The UI Builder contrib is more definable but that is also at a greater level of effort.
    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


      #17
      Got some great help from ksum today. His flow did not work on my HS4 installation. The reason was that my dim lights didn't send "Dim 45%" status text. It sendt just "45%". In the expression you have to change it to
      Code:
      $number($split(status.text, /%/, 2)[0])
      That and remember to change the name of your devices.

      Comment


        #18
        Originally posted by ksum View Post

        Code:
        [{"id":"1acd31e7.da334e","type":"tab","label":"GUI Test","disabled":false,"info":""},{"id":"743ba26e.0a346c","type":"ui_switch","z":"1acd31e7.da334e","name":"","label":"Patio Light UI Switch","tooltip":"","group":"4f7a86f3.bd5eb8","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"control","style":"","onvalue":"{\"status\":\"On\"}","onvalueType":"json","onicon":"","oncolor":"","offvalue":"{\"status\":\"Off\"}","offvalueType":"json","officon":"","offcolor":"","x":660,"y":40,"wires":[["c2762a12.273798"]]},{"id":"c2762a12.273798","type":"hs-device","z":"1acd31e7.da334e","name":"Patio Light","device":"12","server":"fd5a6a5c.dc9868","feature":0,"x":870,"y":80,"wires":[[]]},{"id":"7bf48779.f066c8","type":"status","z":"1acd31e7.da334e","name":"Light Status","scope":["c2762a12.273798"],"x":90,"y":80,"wires":[["f1130c78.ec183"]]},{"id":"41851d20.1395c4","type":"inject","z":"1acd31e7.da334e","name":"On","props":[{"p":"payload.status","v":"On","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","x":650,"y":100,"wires":[["c2762a12.273798"]]},{"id":"3b2843f.7bb4dbc","type":"inject","z":"1acd31e7.da334e","name":"Off","props":[{"p":"payload.status","v":"Off","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","x":650,"y":140,"wires":[["c2762a12.273798"]]},{"id":"5631bec.c1af84","type":"change","z":"1acd31e7.da334e","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"{\"status\":\"On\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":40,"wires":[["743ba26e.0a346c"]]},{"id":"f1130c78.ec183","type":"switch","z":"1acd31e7.da334e","name":"","property":"status.text","propertyType":"msg","rules":[{"t":"eq","v":"On","vt":"str"},{"t":"eq","v":"Off","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":250,"y":80,"wires":[["5631bec.c1af84"],["ac92619.c43cea"]]},{"id":"ac92619.c43cea","type":"change","z":"1acd31e7.da334e","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"{\"status\":\"Off\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":421.59576416015625,"y":106.14030456542969,"wires":[["743ba26e.0a346c"]]},{"id":"4f7a86f3.bd5eb8","type":"ui_group","z":"","name":"Default","tab":"42fec237.9be69c","order":1,"disp":true,"width":"6","collapse":false},{"id":"fd5a6a5c.dc9868","type":"hs-server","z":"","name":"House","host":"192.168.1.10","port":"8008"},{"id":"42fec237.9be69c","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
        I have imported the code from post#1. I have changed the hs device to a on/off plug in my system. I can control it with the on and off buttons in the flow. The status of the hs device in the flow does not change, nor does the status of the dashboard switch. The dashboard switch only works when the status of the hs device is in a the same state as the dashboard switch. Meaning, when the the actual device is on, and the dashboard switch shows on and I click on it it turns off the device. But the dashboard switch stays on. When I click it again, nothing happens. When I change the state of the device in HS, its not reflected in the Node Red flow hs device or the dashboard switch

        Comment


          #19
          Originally posted by mikee123 View Post

          I have imported the code from post#1. I have changed the hs device to a on/off plug in my system. I can control it with the on and off buttons in the flow. The status of the hs device in the flow does not change, nor does the status of the dashboard switch. The dashboard switch only works when the status of the hs device is in a the same state as the dashboard switch. Meaning, when the the actual device is on, and the dashboard switch shows on and I click on it it turns off the device. But the dashboard switch stays on. When I click it again, nothing happens. When I change the state of the device in HS, its not reflected in the Node Red flow hs device or the dashboard switch
          Did you open the first node in the flow, the one called Light Status and make sure your new HS Device is checked? (see below) Also, make sure you have your HomeSeer server selected in the HS Device. I suspect this is done else you wouldn't see your plug to choose when editing that node. The text under that HomeSeer device's node should change to match the HomeSeer value when you toggle the plug On/Off with HomeSeer. the Status node at the beginning looks far a change in the displayed status of any nodes checked in it's setting (image below) and then initiates the flow by sending a message with that Status as the as part of msg.status. Also note that the Switch node (second in the flow) needs to have the proper values as shown under the HomeSeer node. So if it is true/false, then you need values for that as well. I believe the initial version in that post had "On" and "Off" values.

          If you like, post an export of your flow (or DM me) and I can look to see what the problem may be.

          Regarding the Status Node (first in the flow) edit it and make sure your HomeSeer Device (the plug) is listed and checked, similar to my Patio Light below.

          Click image for larger version

Name:	image.png
Views:	169
Size:	48.1 KB
ID:	1573696
          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


            #20
            Originally posted by ksum View Post

            Did you open the first node in the flow, the one called Light Status and make sure your new HS Device is checked? (see below) Also, make sure you have your HomeSeer server selected in the HS Device. I suspect this is done else you wouldn't see your plug to choose when editing that node. The text under that HomeSeer device's node should change to match the HomeSeer value when you toggle the plug On/Off with HomeSeer. the Status node at the beginning looks far a change in the displayed status of any nodes checked in it's setting (image below) and then initiates the flow by sending a message with that Status as the as part of msg.status. Also note that the Switch node (second in the flow) needs to have the proper values as shown under the HomeSeer node. So if it is true/false, then you need values for that as well. I believe the initial version in that post had "On" and "Off" values.

            If you like, post an export of your flow (or DM me) and I can look to see what the problem may be.

            Regarding the Status Node (first in the flow) edit it and make sure your HomeSeer Device (the plug) is listed and checked, similar to my Patio Light below.

            I have sent you a DM with the flow. I cant see any obvious mistakes. But the HS node in the flow does not change state when I press on or off, even though the plug/hs device do change. I just had a look of how I would control this device from node red.
            Attached Files

            Comment


              #21
              mikee123 Does the Status/Graphics screen for your HomeSeer device have values as shown here, or are they different? The original flow uses the values in the Status column.
              Click image for larger version

Name:	image.png
Views:	172
Size:	86.9 KB
ID:	1573716
              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


                #22
                This is my device:

                Click image for larger version

Name:	image.png
Views:	167
Size:	81.8 KB
ID:	1573724
                Attached Files

                Comment


                  #23
                  I have got it all working, including a dimmer. What is not working is 'Last'. I am not sure how to trigger last. Is the on/off switch supposed to trigger last when turned on ? If so, that does not work. Looking at the 'last' switch, that sets the device to 255 and not last value ? I used the code in 'The complete flow of the On/Of and dimmable UI items is here in case you need it:'

                  Now I am trying to work out how best to control multiple dimmers from this flow

                  I was using the status node for 2 on/off switches and 1 dimmer, that works fine. I have added a second dimmer. Now, when I dim from HS4, both dimmers get set to the same value. Do I need to use another status node for the next dimmer ?

                  This is the flow at the moment

                  Click image for larger version

Name:	image.png
Views:	163
Size:	125.1 KB
ID:	1573852

                  Comment


                    #24
                    Glad you have the initial portion working!

                    Regarding your current items, here is what I see:

                    Your 2 dimmers are getting the same value because you do not have a second Switch Node to determine which has been controlled so you are changing both on the Dashboard. Take a look at post 3 in this thread. You are missing the Switch node which shows in the second Flow image. I circled it below. It will be similar to the Switch node which feeds the On/Off Dashboard nodes. It does the same thing, just for the dimmable devices.

                    I only use 1 Status node, so select the HomeSeer nodes in that. You are also missing the 2 SubFlows from the same referenced post. The last 2 in that write-up. In the image below these are the items between the bottom 4 Dashboard and 2 HomeSeer nodes. Import those and insert each on the proper wires.

                    From the image of your flow that SHOULD be all that you need. All of the units I controlled in my write-ups were z-wave units. Provided other dimmable type devices use the same Last and % status settings in HomeSeer, they should work.




                    Click image for larger version

Name:	image.png
Views:	163
Size:	213.9 KB
ID:	1573867
                    Attached Files
                    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


                      #25
                      I have solved it slightly different, it works but have another couple of questions. My Bar Dimmer is a Zwave switch, I'll post the status. The issue I have is when I use HS4 to set the dimmer to anything, the corresponding dashboard switch stays off. The reason I believe is the way the status is structured. From 1 to 99 its Dim. So the input node will not report it as on. So that means if I use HS4 to turn the dimmer on dim, I cannot use the dashboard switch to turn it off. Does that make sense ?

                      Click image for larger version

Name:	image.png
Views:	153
Size:	158.4 KB
ID:	1573886
                      Click image for larger version

Name:	image.png
Views:	144
Size:	93.7 KB
ID:	1573887
                      Click image for larger version

Name:	image.png
Views:	149
Size:	66.2 KB
ID:	1573888

                      Comment


                        #26
                        As mentioned, my dimmers are also z-wave dimmers. The only difference in the settings on mine is that I do not have the 100 to 254 section set.

                        Use the Subflows from post 3. I think your issue may be in how your flow handles this portion of the controls. You can import it and put the nodes inside such in your flow if you want it all in one flow for the moment. Otherwise I would need an export of the updated flow to better troubleshoot without a lot of screen captures showing the various node settings. Your Bar Dimmer has an extra node in front of it and I do not know what the settings are in the 3 yellow nodes left of the HomeSeer Bar Dimmer node. It appears you have not tested the other node, at least prior to the image being captured. The subflows are used so that if you ever need to change something they set, you only need to do so once, and not once for every device.

                        From my original flow I am able to turn lights on/off from the dashboard, HomeSeer, or the physical device in any order. When I do so with the dashboard, dimmable lights turn on at their last dim level. A slider is available for dimmable lights and if I change a dim level it will turn the light on if it is off and set the dim level.
                        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


                          #27
                          I was looking at the subflows. I never used them and I tried to understand. The screenshot of the switch in post 24, cannot be from the one circled in red, as it has 4 outputs ?
                          Also my Zwave dimmer reports "44%" instead of "Dim 44%". I tried Radhoo suggestion
                          Code:
                          $number($split(status.text, /%/, 2)[0])
                          (copied and pasted) but when deploying it threw an error in formula)

                          03/11/2022, 18:04:36node: debug 2
                          msg : Object
                          object
                          status: object fill: "yellow"
                          shape: "dot"
                          text: "44%"​

                          Comment


                            #28
                            Originally posted by mikee123 View Post
                            I was looking at the subflows. I never used them and I tried to understand. The screenshot of the switch in post 24, cannot be from the one circled in red, as it has 4 outputs ?
                            Correct, the Switch Node image in post 24 is not of the circled one. You were missing the circled one. The screenshot was for the first Switch node in the flow, directly after the Status node, to show how the Last and % items are set to confirm you had yours set the same. Especially make sure that you do not have spaces in your comparisons.

                            For Subflows, import the two from Post 3 and you will see them as Nodes in the left side panel of available nodes. Should be the first grouping in the list. Just add it like any other node. Think of it as the same as calling a function in another language. Here is mine:
                            Click image for larger version

Name:	image.png
Views:	152
Size:	26.7 KB
ID:	1573914
                            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


                              #29
                              Ok, got the subflows working for my Bar Lights. But when I change the dimemr in HS4, its not reflected in the dimmer node in the flow. So I need to edit the subflow, to process "44%" instead of "Dim 44%". Can I edit the subflow ? I would create one for "Dim 44%" and another one for "44%" I dont know how to edit the split statement though

                              Comment


                                #30
                                Let's revise the Change node to use this. It will remove any non-numeric value so it will work with or without "Dim ":

                                Code:
                                $number($replace(status, /[^0-9]/, ""))
                                Click image for larger version

Name:	image.png
Views:	163
Size:	20.6 KB
ID:	1573930

                                I have this node as shown below while you have multiple copies at a later point in your flow.

                                ​​Click image for larger version

Name:	image.png
Views:	144
Size:	176.6 KB
ID:	1573931
                                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