I have ZERO automations in Home Assistant. EVERYTHING is in Node-Red.
Because Node-Red and Home Assistant are 2 separate applications. You should be using the DEBUG node in Node-Red to troubleshoot Node-Red.
I have ZERO automations in Home Assistant. EVERYTHING is in Node-Red.
Because Node-Red and Home Assistant are 2 separate applications. You should be using the DEBUG node in Node-Red to troubleshoot Node-Red.
This is what I’ve been doing with the debug and insert nodes. So much better than yaml. But using notification nodes is a good idea too.
Blockquote
Because Node-Red and Home Assistant are 2 separate applications. You should be using the DEBUG node in Node-Red to troubleshoot Node-Red.
Debug is real time. What about history? The issue I had was the alarm was arming while I was asleep so I had to use the logbook to track down the issue. The log shows if an automation was run (in yaml) but it doesn’t show if a node red flow was run. From what I can tell there is no historical data in node red except the time stamps that appear under some of the nodes.
If you keep a page open to Node-Red, the debug logs are there, or you can log to system and monitor the system logs.
Because that’s a part of Home Assistant.
Because Node-Red is not a part of Home Assistant.
You can log everything to a database, or to the system log, or to a file. You can literally do anything you like.
I understand that it’s separate from HA and wasn’t expecting it to appear in the logs. Just stating the fact that I can’t look for node red data there like the HA automations. Thats a useful troubleshooting tool.
A database or the system log sounds promising. Do you mean collecting data in a database or system log that is external to HA or Node Red?
You can do whatever you like.
Log everything Node-Red does to a file, or to a database external to both
You can use the call-service node and write a custom logbook entry.
That is perfect! Then I can have the node red logs in the same log as HA. Nice!
That was me asking.
I now run all automations exclusively in Node-Red. This is now setup on a dedicated RPi (HASSIO Install)
I have all of my automations moved over to node red now. No troubles.
Do you have it running on a separate machine or as an add-on in home assistant? I’m currently using it as an add-on.
Congrats. Now you can enjoy tweaking them with no restarts.
I suppose that depends how much you have it doing. I was bought a couple of RPI’s for xmas and had seen the odd delay so decided to split out across the 2
I know there’s a lot of people who have NUC’s but I wanted to keep the power consumption low and keep the simplicity of HASSIO install.
Both HASSIO installs;
RPi 1 - Interface, state/device management, discovery, MQTT
RPi 2 - Node-Red (all automations)
It’s easy enough migrate so I wouldn’t bother investing in more hardware unless you know your going to get performance issues. Im very happy with my setup but it’s certainly worth considering a NUC given the number of people who seem to be using them.
This ^^^^
The inject and debug nodes are probably the biggest reason to switch over to node red. Giving you the ability to tweak and test repeatedly without system restarts.
So I haven’t been able to get this to work. I have it set up exactly like the example but it doesn’t seem to work. Have you gotten this to work?
This is the script:
nodered_logbook_entry:
alias: Node Red Log Book Entry
sequence:
- service: logbook.log
data_template:
name: Node Red
message: flow started
i log all my NR actions to MQTT with timestamps.
Not a bad idea. But ideally I would like to have them in the logbook so I can follow the sequence of events all in one linear log. But MQTT may be another avenue if this doesn’t work.
They run mostly asynchronous, so there’s not much reason to log them together.
When I am debugging a flow. I sometimes make my own log file using the file node.
then add MQTT sensors in HA to read the NR-MQTT logging.
[{"id":"996a6cc6.45073","type":"inject","z":"5eb3594f.d294b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":780,"y":1712,"wires":[["3e231ef5.6446d2"]]},{"id":"3e231ef5.6446d2","type":"api-call-service","z":"5eb3594f.d294b8","name":"","server":"ef067c6f.620e6","service_domain":"logbook","service":"log","data":"{\"name\":\"Kitchen\",\"message\":\"is being used\",\"entity_id\":\"light.kitchen\",\"domain\":\"light\"}","mergecontext":"","output_location":"","output_location_type":"none","x":956,"y":1712,"wires":[[]]}]
This!! ^^
It worked perfectly. Thanks!!
I pretty much do this, I have a ‘House Log’ channel in Telegram and log things like security, climate, presence to it.
But I generally keep all my debugging notifications in the flow instead of deleting them. Instead I have an input_boolean in HA to turn debugging notififcations on/off. So wherever I had debugging notifications when I was making the flow, I just drop in a condition: only if this input_boolean is on.
So if I need to go back to it later, I can just turn on my master debug notification switch and then my ‘House Log’ becomes much more detailed. Fix it and turn it back off.
That’s the only logging I do, since I have all my automations in NR as well I don’t really find the Logbook useful so I just have it disabled.
Is there any advantage to having the log disabled? I’m still debugging every now and then. Mostly when I make a new flow that unknowingly overlaps with another one.
At some point though I can see not really needing to debug and not needing the log, once I stop tweaking the system.