Node-RED nodes for hubitat

I do the same as erltrek, I also use homebridge to expose Arlo cameras to NR.

1 Like

I'm having an issue anytime I need to reboot the Rpi4 that Node-Red runs on. My flows stop working unless I manually click on a hubitat node and configure the webhook again. Am I missing a setting somewhere to persist this connection on reboots?

I have 2 Rpis, Rpi3 & Rpi4, which reboot every nght and I've never have had any issues

Some thoughts:

  • Something going on with the DNS? Are you using fixed/static IP addresses or "hub.local"?
  • Could it be something with your firewall?
  • Are you using security on your HE?
  • Running HTTPS?
1 Like

Using static IP for both home assistant (node-red) and hubitat. They are both on the same local subnet, so no firewall issues. I am using a user login/password on hubitat, no https.

2 Likes

Are you using the Websockets option?

1 Like

No websockets

1 Like

No idea. I reboot my node-red containers/VMs all the time, flows always work fine after reboot for me.

I know that doesn't help, just a data point.

2 Likes

If you reboot the HE hub instead does it do the same thing?

1 Like

Another data point here. Seems to work after a reboot.

I haven't tried this. Will play around with this a little more.

1 Like

Hubitat reboots don't seem to be the issue. The issue persists anytime I restart home assistant. To fix, I have to click the configure webhook button to see the green check mark.

:man_shrugging:

Running node-red inside of HA often does weird stuff. Can't help you there - I would recommend NOT running node-red inside of HA.

1 Like

I think I figured it out. I am also running the Hubitat integration in Home Assistant which also makes use of the Maker API event URL. It overwrites it on reboots in order to receive event updates, therefore wiping out the Node-Red webhook config. Looks like these two can't be run side by side.

2 Likes

You need to use separate MakerAPI instances for each integration. Which is pretty much true for every instance where an external integration uses MakerAPI.

4 Likes

Thanks. I had no idea. Good to know.

Good catch, I updated the prerequisite in the first post

A dedicated Maker API instance with the following option enabled

1 Like

Sorry if this is a bad question or is somewhere else I'm still watching the node-red tutorials....

How do I access the on/off status data of my devices? Is the only way to store them in a global variable? Then access said variable?

The device node keeps the status of the devices and you can inclu!de it in the flow instead of keeping the value in a variable

If you don't want it to trigger events and just want the status, then uncheck the "Send Events" check box:

2 Likes

Not at all! The HE Nodes are great.. The "device" node and the "event" node are used for this purpose. You can get the status/state of a device by simply doing this..

If you want to dynamically get the event then as @rakeshg pointed out check the "send events" checkbox and every time an event fires for that device you can do something with it...

Also you can use the "events" node as well. This is more like a firehose and all events for the hub are processed. The nice thing about this is you can use it to filter certain events battery reporting etc across devices.

edit: It should be noted that repeatedly checking a device node in this manner does NOT impact the hub at all. The HE Nodes cache the states until something changes. This is a great thing as it reduces potential maker request spamming. You do have to be aware though if the Hub restarts you might want to make sure the cache is rebuilt - you can do this by editing the hub config in NR and making sure under the advanced tab the "Rebuild cache on Hubitat systemStart event" is checked.

1 Like