Announcement

Collapse
No announcement yet.

Node Red status node not always reporting HS device status

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

  • ksum
    replied
    Originally posted by nl_user View Post
    ksum Thanks for the help. I will look into that. I'm waiting for some new Rpi 4 to arrive, sometime when they become available again (order the moths ago) Than I can have a stand alone Node -red server.
    You can do a Windows install of Node-Red for now and move it later. I also hear the Orange Pi devices are good alternatives which are available.

    Leave a comment:


  • nl_user
    replied
    ksum Thanks for the help. I will look into that. I'm waiting for some new Rpi 4 to arrive, sometime when they become available again (order the moths ago) Than I can have a stand alone Node -red server.

    Leave a comment:


  • nl_user
    replied
    Originally posted by kenm View Post
    Have you confirmed the IP address difference I pointed out in post #19? The initial status poll after a deploy is done using the JSON interface while status updates are sent via the webhook. If the HS Server Node is pointing to the correct IP address but the webhook isn't pointing to the NR instance, you will get the exact behaviour you are seeing.
    The ip address in the flow I published here was different for safety reasons. But did not make much sense The ones I use are correct as far as I can see.

    Leave a comment:


  • kenm
    replied
    Have you confirmed the IP address difference I pointed out in post #19? The initial status poll after a deploy is done using the JSON interface while status updates are sent via the webhook. If the HS Server Node is pointing to the correct IP address but the webhook isn't pointing to the NR instance, you will get the exact behaviour you are seeing.

    Leave a comment:


  • ksum
    replied
    Others have had difficulty connecting to a HAss OS install of Node-RED and have ended up installing Node-RED outside HAss OS and connecting to that. What you have found is that there is something wrong with your communication between Node-RED and HomeSeer.

    Are you doing anything with Home Assistant which you cannot do with HomeSeer? If yes, maybe it can be done with Node-RED and you can not run 2 hubs. Otherwise, you can have more than one Node-RED "server" running and keep one for HAss and the other for other items as well. If you are running HAss on a Raspberry Pi and do not have a second device for a second server, you could use a second SD Card to install the Raspberry Pi OS and then Node-RED to test this first. On the second card install the Raspberry OS and Node-RED, install the HomeSeer contrib and configure, then import my flow in the previous post and you should be good. (Note that you ultimately want to run a Raspberry Pi using a USB Solid State Hard Drive [USB SSD HD} and not an SD Card.)​

    While previously mentioned users have done the below items and these worked yet still had problems, you if you want to keep trying to use the HAss OS install, double check that the IPs are correct in your setup, and that neither are pointing to more than one instance of same installation for the other.
    • From the computer running HomeSeer, browse to http://192.168.0.31:1880 and make sure it opens your Node-RED editor.
    • From the computer running Node-RED, browse to http://192.168.0.30:80 and make sure it opens your HomeSeer home screen (likely the Devices screen)
    These suggestions were not made to those users:
    You might try changing the port used for Node-RED. I have seen suggestions of a conflict when accessing the HAss install externally. Also, try changing the url in HomeSeer to point to https as opposed to http. I do not know if HAss sets up a certificate or not but the references I have seen add the S. I have also seen reference to https://<inserthasurl>/api/webhook/<insert webhook ID> which to me suggests the url may be different.

    Leave a comment:


  • nl_user
    replied
    Thanks for your feedback. I'm not a programmer, more a learning by doing person. So, I did search and combined some of the things I found in my test flow.. That is why my flow had some of the parts in it.
    - the user name is intentional that way
    - I tried with an on/ off device and it did not update in Node-red (the Last Change Time Updates on Status Change Only​ was checked).
    - I'm also using McsMqtt but still find it a very complex plugin.
    - used your adapted flow but the result is still the same no update of the value (watt) I checked when it changed and did not see that happening in Node-red.

    Leave a comment:


  • kenm
    replied
    I deduced that it was Home Assistant since his login for the HomeSeer Server node is "home_assistant".

    EDIT: Just noticed something else... The username being used to access HomeSeer is "home_assisant" without the "t". Is that intentional?

    Leave a comment:


  • ksum
    replied
    And just a side note: if you are using mcsMQTT it can write data from HomeSeer devices to InfluxDB. I do not know if you can control the data format, though. That said, this is a good way of figuring out Node-RED and some of the capabilities.

    Leave a comment:


  • ksum
    replied
    Am I to understand that you are running Home Assistant and installed their version of Node-RED inside their OS? If yes, there may be some additional settings which may be needed on the HAss side. (To me and many others, HA = Home Automation)

    The first ting I would do for testing is try using a light switch or something else you can control in HomeSeer. If your HomeSeer node is has Last Change Time Updates on Status Change Only checked, then Node-RED will only get data when the HomeSeer Device Status changes. So if the Watts doesn't change, nothing is triggered in Node-RED and therefore no data is saved to InfluxDB. By testing the connection with a device we can manually control to make sure the communication is happening, we get a more controlled test. Once you know the communication is working, then look into the HomeSeer Thermostat Watts device and see when changes occur. Note that if you are charting with Grafana, it does not look beyond the charting timeframe, so if the device's value does not change in InfluxDB inside the charting timeline, Grafana will have nothing to show.

    Get rid of that Function node. It isn't doing anything a Change node can't do and is wasting resources. Sure, you have a more than capable system and that one function node isn't doing much so you do not see a processor hot, but add a bunch up and it is just poor programming. Also, using a Change node gives you a visual of what is going to happen while the Function node is a black box unless you give it a name. As for your name, you are not Getting the value from the thermostat. That suggested to an outsider that you are polling the device for the value. Instead you are Moving or Changing the variable. The Change node to do this is configured as shown below.
    Click image for larger version

Name:	image.png
Views:	183
Size:	13.3 KB
ID:	1582991



    What is the reason to convert msg.payload to JSON? JSON should only be used to send data between programs. The HomeSeer node outputs an Object and is what you should send through your flows for easier manipulation. Then only time you should convert from and to JSON is for sending data outside Node-RED or for use with poorly written contrib/nodes. I believe the HAss nodes use this as many folks on that side seem to fight with JSON.

    This is what your flow should look like. Ignore the error message under the node. This is because I do not have the same HomeSeer setup and did not change your node to use my setup.
    Click image for larger version

Name:	image.png
Views:	105
Size:	18.8 KB
ID:	1582992

    Here is the Import for that:
    Code:
    [{"id":"fa7003.cd5af","type":"influxdb out","z":"9cf79844.811da8","influxdb":"c3d410e56f3ec069","name":"","measurement":"watt","precision":"m","retentionPolicy":"","database":"","retentionPolicyV18Flux":"","org":"","bucket":"","x":880,"y":160,"wires":[]},{"id":"22509df2.cebb8a","type":"debug","z":"9cf79844.811da8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":570,"y":100,"wires":[]},{"id":"b6a82334.e36db","type":"debug","z":"9cf79844.811da8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":850,"y":100,"wires":[]},{"id":"66ac6f36e10b329d","type":"hs-device","z":"9cf79844.811da8","name":"Boven Badkamer Thermostat Watts 4","device":0,"server":"367ff7807724edc9","feature":0,"reportonstartup":true,"x":210,"y":160,"wires":[["22509df2.cebb8a","e29c2be8739ae66c"]]},{"id":"e29c2be8739ae66c","type":"change","z":"9cf79844.811da8","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":160,"wires":[["b6a82334.e36db","fa7003.cd5af"]]},{"id":"c3d410e56f3ec069","type":"influxdb","hostname":"192.168.0.39","port":"8086","protocol":"http","database":"homeseer_data","name":"homeseer_data","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true},{"id":"367ff7807724edc9","type":"hs-server","name":"HomeSeer Server","host":"192.168.0.39","port":"80"}]

    Leave a comment:


  • mikee123
    replied
    Originally posted by nl_user View Post
    I'm facing more or less the same. I have a device in Node-red which has some power measuring. I want to have the values stored in influxDb I have the flow working but the device is not updating its value. Only when deployed the first time. Did I forget something here? I can see the value (once) in the database. So the HomeSeer device is the problem. The HomeSeer server and Nod-red are on two different devices in the same network.

    HTML Code:
    [{"id":"9cf79844.811da8","type":"tab","label":"InfluxDB","disabled":false,"info":""},{"id":"fa7003.cd5af","type":"influxdb out","z":"9cf79844.811da8","influxdb":"c3d410e56f3ec069","name":"","measurement":"watt","precision":"m","retentionPolicy":"","database":"","retentionPolicyV18Flux":"","org":"","bucket":"","x":1000,"y":200,"wires":[]},{"id":"22509df2.cebb8a","type":"debug","z":"9cf79844.811da8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":570,"y":100,"wires":[]},{"id":"b6a82334.e36db","type":"debug","z":"9cf79844.811da8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":990,"y":280,"wires":[]},{"id":"66ac6f36e10b329d","type":"hs-device","z":"9cf79844.811da8","name":"Boven Badkamer Thermostat Watts 4","device":"766","server":"367ff7807724edc9","feature":"775","reportonstartup":true,"x":210,"y":160,"wires":[["22509df2.cebb8a","83eefe53126f954b"]]},{"id":"41fc126c7222a379","type":"function","z":"9cf79844.811da8","name":"get value from thermostat","func":"// msg.topic = 'currentTemp';\nmsg.payload = msg.payload.value;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":360,"wires":[["fa7003.cd5af","b6a82334.e36db"]]},{"id":"83eefe53126f954b","type":"json","z":"9cf79844.811da8","name":"","property":"payload","action":"obj","pretty":false,"x":490,"y":200,"wires":[["41fc126c7222a379"]]},{"id":"c3d410e56f3ec069","type":"influxdb","hostname":"192.168.0.39","port":"8086","protocol":"http","database":"homeseer_data","name":"homeseer_data","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true},{"id":"367ff7807724edc9","type":"hs-server","name":"HomeSeer Server","host":"192.168.0.39","port":"80"}]
    Click image for larger version

Name:	Scherm­afbeelding 2022-12-24 om 14.45.26.png
Views:	229
Size:	57.3 KB
ID:	1582963
    Inject the HS node with anything in payload and set topic to sync

    Leave a comment:


  • kenm
    replied
    I just loaded your flow and you have your HomeSeer Server set to 192.168.0.39 not .30.

    Leave a comment:


  • nl_user
    replied
    As far as I can see now nothing changed. Still only have it once and than it stays on until I deploy the flow again.

    Leave a comment:


  • nl_user
    replied
    Great I'll try that first.

    Leave a comment:


  • kenm
    replied
    Then you need to remove the webhook for .30. there's a documented issue with webhooks in which updates won't get sent if one of the webhooks fails. In your case, .30 will always fail since you aren't running NR on that IP.

    Leave a comment:


  • nl_user
    replied
    No it is running on 31 HomeSeer is on 30. Can I just remove the hook for 30?

    Leave a comment:

Working...
X