Node-RED nodes for hubitat

I have seen this a couple times, can I ask why this is? Could it be why my device do not update automatically?

I believe it then works more as a query, rather than about to send an instruction.

It should only be checked on nodes where you want it to initiate a message flow (is at the beginning of the flow).

If it is in the middle of a flow you typically want it off, as you don't want the flow to begin/start the middle (usually).

Typically device nodes in the middle only want to evaluate when they receive an incoming msg.

2 Likes

Do your 'starting sensors' "change state" automatically or do you need some kind of "trigger"?

Mine still won't update in NR, even when I see it change in HE.

Are you using websocket or webhook? If you're using webhook, and there's a config error, then they will not update.

1 Like

It was webhook. I did not know I had a choice, until you said something. I clicked the websocket button, now it works.

Thank you good sir.

For another NR newb

2 Likes

And off down the rabbit hole he hops :joy:

3 Likes

Its definitely worth it. My Good Night Routine is over 20 devices but usually only 4-5 are on so I query all of the ZWave Plus devices to see if they are on and it made the routine noticeably quicker to complete. For my ZWave non-plus devices, I just send the OFF command in case the state is wrong.

2 Likes

I think I may reboot now in reediness. I think this is the biggest flow I have up to now.

2 Likes

Automatically whenever they change in hubitat. In this case they happen to be life360.

Just pay attention to the differences between the two...

websocket

  • gives you events for all devices, not just the ones selected in Maker API.
  • ws does NO deduplication of events (aka you could get multiple present/on/etc events in a row when using the ws connector). So you could get things triggering that wouldn't if you use webhook. Whether this is important or not depends on your logic and devices.
  • ws is unsupported by hubitat and could go away at any time (although it hasn't in > a year it has been in there).
  • ws events have slightly different data than webhook (no type - 'physical'/'digital' for one).
  • ws is a little faster than webhook.
  • ws requires less configuration - just the IP of the hub

Webhook

  • officially supported by Hubitat
  • events have more details in some cases (type, and a few other items)
  • only sends events for devices specified in maker api
  • sends events post-internal deduplication, so events sent should match the events in a device history log
  • requires a little more config (have to configure the POST url in maker api)
6 Likes

any pointers on how to "fix" what ever was preventing it from updating when I was using wh?

If it isn't updating via webhook it is almost always a POST url config issue or a host firewall issue on the machine running node-red.

99% of the time it is the POST url. Users either put in the wrong IP, forget to put in the port, or other wrong info. Clicking "Confgure Webhook" only checks that it was successfully written to hubitat - not that the URL is actually correct.

Example from one of mine.

192.168.2.5 is my NODE-RED IP (not hubitat).
1880 is my NODE-red port (the default port #)

Also make sure you actually type in the ip/port info! The config node will show what it thinks should go in there in 'grey', but it still needs to be typed in and the config node updated.

2 Likes

Synology NAS. I had the firewall turned off. I turned it back on, made the exception for NR port and now it is working. :thinking: something to keep an eye on, but thank you for the explanation of dif.

1 Like

This may want to make you flip a table... lol

From what I see, you check all yours doors and windows to make sure they're all closed. I do something similar, except in 1 line for 9 doors/windows.

HA has this awesome little node called "get entities" which will scan a group and output every device in that group which matches the condition. I had been doing them the same way till I found this gem.

4 Likes

Fyi mine has an underscore in the path :man_shrugging:

image

Thanks for the help. I have been trying to do this in RM for months and think I finally got it in NR.

1 Like

If you cannot remove underscore from the input, it's because you have other config nodes that already bind the /hubitat/webhook
You can view all your config node in the Configuration nodes menu
Screenshot from 2020-07-05 20-10-40

1 Like

@TechMedX My 2nd hub has the underscore added to it. Do you you have 2 hubs connected to Node Red?

1 Like

Yes, both my 'Devices' and 'Apps' hubs (the Apps hub has some zigbee lights on it too)

To be honest, the path name doesn't matter. But if you want to be clear in your config, you can change the path to /hubitat/devices/webhook and /hubitat/apps/webhook (or whatever you want to distinguish your both hubs) or leave underscore :wink:

1 Like