Sidehistorik
...
Check out https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/custom_integration/ for some tips also.
And You are ready to go.
Automations
Lights
Now, Home Assistent is my "heart" of the Installation, but starting to use it, I realize that it has Integrations for Philips Hue and MQTT directly, so Home Assistant could be bypassed for several automations.... I guess that more religion than tech...
My first Automatins in Home Assistant was to bridge my propritary ZenseHome system to Philips Hue:
Later on, ZenseHome actually got native Hue support... but Im stil using Home Assistant.
So, I moved this to Node-Red:
The "Listen" is listening om MQTT Directly and turns on the ZenseHome ceiling outlet (just to be sure) and turns on the Philis Hue lightbulbs, the latter 2 both through Home Assistant.
So, I moved all these similar automations from Home Assistant to Node-Red.
Stream Deck Support
My youngest son got a Stream Deck and we wanted to be able to trigger stuff from the buttons, so I looked into the Home Assistant API - and well, You need authetications and all sorts of "complicated" stuff.
So I turned to Node-Red, and found the "http in" node, which setup and url that Node-RED listens on:
Added the toogle for the Home Assistant entity (A Philips Hue Plug):
And wired them together:
Now, going to http://sparrow:1880/switch-vr simply toggles the VR on/off - no authentication or similar needed, the URL can be put directly into the Stream Deck software and assigned to a Button.