I recognized an issue with my NodeRed-Installation everytime when I restart my Openhabian-Server. Openhab does not send events to Node-Red until I update the Node-Red-Workflow manually (click the Update-Button in Node-Red ). After doing that all Workflows working again correctly!
Is there a configuration/option to do this manual step automatically after restarting the server?
I had this issue as well, which I think is caused by the fact that Node-RED starts before openHAB is ready to accept REST API calls. If you are using a Linux OS with systemd (such as openhabian or Debian) you can change the systemd service file for Node-RED.
You should be able to find this file at:
/lib/systemd/system/nodered.service
Modify the “Unit” section:
[Unit]
Description=Node-RED graphical event wiring tool
Wants=network.target
# === Add or modify these lines ===
After=openhab.service
# =================================
Documentation=http://nodered.org/docs/hardware/raspberrypi.html
If your system is slow (like my Raspberry Pi) you can add an additional sleep command in the “Service” section before Node-RED is started:
[Service]
# ... other lines ...
ExecStart=/bin/bash -c 'sleep 60; /usr/bin/node-red-start'
# ... other lines ...
Put “sleep 60;” before the command that is there already and make sure the commands are all in-between the brackets ('). You can increase the timeout if needed.