Node-RED nodes for hubitat

Actually, I'm having issues now where my Flows don't react to calls by Maker API

I see in HE logs that Maker is posting to my Webhook Url (no underscore business in my settings)

I've got three "flows", two completely do not work, one has one part that works, and none of them spit out Debug data

I don't see button pushes here in NR. (do see in HE logs and the webhook call)

And I don't see the contact change from closed to open (but Hubitat does and it also posts the action the NR webhook)

Screenshot 2020-03-01 17.32.29

On this one, the first item updates the mode when i change it through the HE iOS app, but no debug data and it doesn't run the logc

@morningz @mike Can you give me the log of Node-RED server when the server is restarted? You should see on which endpoint NR listen
Note: the log location depends on how you have installed NR

Is this what you're looking for? I run node red in Docker

But, having restarted node-red, it appears everything is working again. I did have a random Hubitat Hub (a third, I have two) that appeared in the configuration page for Node-Red, and it was un-configured. I removed it, after it errored (only with the upgrade to 0.21, I noticed 3rd random hub there for a few nights), and error messages went away, but obviously something was still broken, needing a Node-Red restart.

1 Like

This is what I use to restart node-red.

[{"id":"eb5fd1a5.c5bef","type":"exec","z":"c585db89.425658","command":"sudo ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"System Command","x":382,"y":93,"wires":[[],[],[]]},{"id":"bf3baac9.5f56a8","type":"inject","z":"c585db89.425658","name":"Restart node-RED","topic":"","payload":"node-red-restart","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":142,"y":93,"wires":[["eb5fd1a5.c5bef"]]}]
1 Like

I'm not sure what I am looking for log-wise.

The "Event Log" available through the Web Interface is empty

The Debug console is empty

If I SSH into the Pi, go to the node-red directory and type "node-red-log" (seems this is a Pi-specific thing) I get this JSON, which is updating real time as I type this post

POST /hubitat/webhook with body:
{ content:
   { name: 'pushed',
     value: '1',
     displayName: 'Office: Dimmer Switch',
     deviceId: '28',
     descriptionText: 'Office: Dimmer Switch button 1 was pushed [physical]',
     unit: null,
     data: null } }
POST /hubitat/webhook with body:
{ content:
   { name: 'pushed',
     value: '2',
     displayName: 'Office: Dimmer Switch',
     deviceId: '28',
     descriptionText: 'Office: Dimmer Switch button 2 was pushed [physical]',
     unit: null,
     data: null } }
POST /hubitat/webhook with body:
{ content:
   { name: 'pushed',
     value: '3',
     displayName: 'Office: Dimmer Switch',
     deviceId: '28',
     descriptionText: 'Office: Dimmer Switch button 3 was pushed [physical]',
     unit: null,
     data: null } }
POST /hubitat/webhook with body:
{ content:
   { name: 'pushed',
     value: '4',
     displayName: 'Office: Dimmer Switch',
     deviceId: '28',
     descriptionText: 'Office: Dimmer Switch button 4 was pushed [physical]',
     unit: null,
     data: null } }
POST /hubitat/webhook with body:
{ content:
   { name: 'temperature',
     value: '63.52',
     displayName: 'Outside: Mailbox Sensor',
     deviceId: '675',
     descriptionText: 'Outside: Mailbox Sensor temperature is 63.52°F',
     unit: '°F',
     data: null } }
POST /hubitat/webhook with body:
{ content:
   { name: 'energyDuration',
     value: '112.02 Days',
     displayName: 'Master: Charging Pad',
     deviceId: '130',
     descriptionText: 'Master: Charging Pad energyDuration is 112.02 Days ',
     unit: null,
     data: null } }

Found this command searching around

sudo journalctl -f -u nodered -o cat

That also shows the log just like above

This is exactly the log I want, but I want it just after NR restart. It should be something like:

1 Mar 19:59:01 - [info] Starting flows
Starting endpoint for /hubitat/webhook
1 Mar 19:59:01 - [info] Started flows

Also can you confirm me that you only have one config nodes (on UI go to top right and selection configuration nodes)

Actually, it's not working. It works for a few seconds, after first redeployment, then fails. I have two hubs, run Node-Red on docker. Both HE hubs are effected.

Here is the log you requested

Here is 1st hub, showing configured.

image

Here is second HE hub.

image

Edit: The mode node works perfectly, so it's not a config issue (I'd guess)

Mine is the same way, after a restart it works for a little bit, then stops responding

I opened two SSH windows, one with logging running, used the other to run "node-red-restart", here is the log from that

2 Mar 00:17:26 - [info] Stopping flows
HubitatDeviceNode: Closed
Stopping Node-RED graphical event wiring tool...
HubitatDeviceNode: Closed
HubitatModeNode: Closed
HubitatDeviceNode: Closed
2 Mar 00:17:26 - [info] Stopped flows
nodered.service: Succeeded.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
2 Mar 00:17:34 - [info]
Welcome to Node-RED
===================
2 Mar 00:17:34 - [info] Node-RED version: v1.0.4
2 Mar 00:17:34 - [info] Node.js version: v10.19.0
2 Mar 00:17:34 - [info] Linux 4.19.75+ arm LE
2 Mar 00:17:39 - [info] Loading palette nodes
2 Mar 00:17:51 - [info] Settings file : /home/pi/.node-red/settings.js
2 Mar 00:17:51 - [info] Context store : 'default' [module=memory]
2 Mar 00:17:51 - [info] User directory : /home/pi/.node-red
2 Mar 00:17:51 - [warn] Projects disabled : editorTheme.projects.enabled=false
2 Mar 00:17:51 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
2 Mar 00:17:51 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
2 Mar 00:17:51 - [info] Starting flows
Starting endpoint for /hubitat/webhook
2 Mar 00:17:52 - [info] Started flows
2 Mar 00:17:52 - [info] Server now running at http://127.0.0.1:1880/

Here is a video I just made a few minutes ago, the label under "Dimmer Switch" should indicate what button was pressed on this Hue dimmer switch I have right here. The dark window is the log in the SSH terminal window.

Really strange behavior, if I restart Node-RED, sometimes the flows respond for a few minutes but then stop, and most of the time they just do not responsd at all.

When I set all this up last night with whatever version was before 0.0.19 it was working rock solid as I was testing/setting this up.

Really hard to debug ...
It may be related to the multi flows?
I'll try to setup multi flow environment but in the same time, can you test to merge all your flows?

EDIT: probably not flow related ...

As far as I can tell all of my flows are working as expected in 0.0.21... Now, I didn't go and specifically test all 40+ functions I have, but most of them are lights, and... well, my lights are all on that should be on, and the ones that should be off are off - so I believe it is working. :man_shrugging:

As far as multi-flows go, I have 100% of my home lighting in one big flow sheet... Probably 25+ lights.

Are you using security? I'm not, having issues.

Security on what exactly?

Sorry: Enable secure (SSL/TLS) connection (in edit Hubitat config node)

Ah. No, I did not enable that.

I’m do not have SSL checked

To summarize

  1. You restart NR (with only one config node)
  2. All devices fetch their state and status are good
  3. You trigger some events and flows work fine
  4. you didn't touch anything (not deployment or other NR action)
  5. Flows stop to be responsive and there are no more output

Did you have any log between the step 3 and 5 that show error
The video posted show that event is received by NR but not dispatched to the node, which can be caused by:

  • Wrong registered of the device node to the dispatcher
  • the node have been unregistered from the dispatcher

But in all case it doesn't explain the time factor

I need to have the more details possible to identify the problem
You will need to investigate and check every step / config you had made. If possible trying to reproduce on a small/easy flow to be able to import export it for me.

Also which node-red docker version do you use (which hash)? ex:

$ docker images | grep node-red
nodered/node-red                    latest              4565e2a2aa48        3 days ago          448MB

Just for kicks I rolled back to version 0.0.18 and it works fantastic again, just did like 40 events in a row (edit, i've probably run 40 more events on top of that since I originally posted this)

Buttons 1-4 on the dimmer switch and off screen was changing the mode via Dashboard