Announcement

Collapse
No announcement yet.

Node-Red POST input block vs the HomeSeer plugin

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

    Node-Red POST input block vs the HomeSeer plugin

    I am trying to use HomeSeer with node-red, which is installed on the same system as HomeSeer. To configure the HomeSeer plugin in node-red, I created a webhook in HomeSeer. In node-red, it works perfectly. For example, when I turn on a z-wave switch, the status on node-red is instantly updated. So the node-red plugin is working perfectly.


    My problem is that I am trying to set up a second webhook to node-red using the HTTP In block (POST) to receive the raw data from HomeSeer. I am doing this to programmatically parse out device update information to log to influxdb. If I add a new device to homeseer, I don't want to have to make changes in the node-red workflow, which the plugin would require. I created another webhook in Homeseer (http://192.168.0.41:1880/hs4) and in a node-red flow, I created an HTTP In (POST) block with /hs4

    Debugging the msg.payload output reveals SOME updates from HomeSeer, specifically some of my z-wave power meters. But if I turn on/off a switch in HomeSeer, nothing is sent to this second webhook. Any ideas why? I opened a case, but HomeSeer support suggested I post here. Why would the plugin work fine but a standard POST input block not work correctly?



    #2
    I would believe that Node-RED and HomeSeer although are installed on the same computer, are not fully integrated into each other as is the case with Home Assistant and/or ioBroker Or in other words both HA and ioBroker listen to the whole system at the base layer or rather deeply embedded...


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

    Comment


      #3
      As a test, I'd suggest you remove the first webhook temporarily (the one you call "for the plugin") and see if you get all updates. If you do get all updates that's a good indication that the HomeSeer package is interfering with the HTTP In node.
      "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

      Comment


        #4
        You also night look at the HomeSeer side and see if there is a commonality in the devices which are be those which are not sending data. For example, does one group have child devices and the other doesn't?

        Also, if just for influxdb, did you know the free mcsMQTT plug-in has the ability to write days directly to influxdb?

        I personally use a flow with nodes for each device I wish to save data for as I use different measurements in influxdb and this allows me to save different value types. Adding a new device is easy as I just need to add the HomeSeer device node, set the name I want to use, and connect an incoming and outgoing wire. It also means I'm not recording as much, but I'm not interested in historical data on most of my devices.

        I'm going to have to look into this webhook idea a bit once I have time at a keyboard, though.
        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


          #5
          This is working for me. I set up a second web hook in HomeSeer as shown below, the hs/nrtest one:
          Click image for larger version

Name:	hs1.jpg
Views:	160
Size:	24.1 KB
ID:	1539321



          I then configured an HTTP In node as shown below and connected it to a debug node. I seem to be receiving all the device changes from HomeSeer. Note that you may not receive messages when the value does not change if the box is checked to for the Device's setting, Last Change Time Updates on Status Change Only as this will likely not trigger the web hook. This is at least the case for the Node-RED web hook so I imagine this is consistent. It also seems that not including the http output reply slowed slowed things down as HomeSeer was likely waiting for a reply.
          Click image for larger version

Name:	hs3.jpg
Views:	114
Size:	26.0 KB
ID:	1539323


          Click image for larger version

Name:	hs2.jpg
Views:	114
Size:	33.2 KB
ID:	1539322


          I have seen messages from changing a z-wave light switch, mcsMQTT devices as well as mcsMQTT broker connection and other messages, the Ecobee plugin data, virtual devices, the AKGoogleCalendar plug-in.

          Here is the content of the Template node:
          Code:
          <html>
          <head></head>
          <body>
          <h1>Hello {{ payload.name }}!</h1>
          </body>
          </html>
          Click image for larger version

Name:	hs4.jpg
Views:	117
Size:	51.7 KB
ID:	1539324

          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


            #6
            Thank you all for the replies. ksum! thank you. You solved my issue. I didn't realize I had to manually configure an HTTP response block. I still don't know why I was receiving some updates (very few) but I think you're spot on. Failing to send an HTTP response resulted in HS stopping the sending of data because it was waiting for a response. I am now receiving thousands of updates.

            Comment


              #7
              I blew it by failing to test with Postman. I can see the request just hanging when I don't build the webpage and response. Thanks again ksum

              Comment

              Working...
              X