Websockets are the way. It’s possible to subscribe to all the events then filter them… it’s just a bit of a PITA managing the websockets and all the connection/reconnection states, making sure it’s not stale, detecting when remote is down, retry logic etc.
Just had trouble finding the code… it was before custom nodes exist so it’s in a branch of my n8n repo
Hi there,
I just stumbled upon this thread.
I had the same problem and implemented some nodes:
This has a trigger node for Home Assistant events and Home Assistant triggers, as well as a node for doing actions, retrieving areas, entities, devices, etc.
It also has generic nodes if you want to call something weird, or a HA plugin.
Give it a try if you want, any feedback is appreciated
@ Simiil Hi, Could you share the trigger function sample? I try to set Specify Body by Using Fields Below and config Body Parameters but show some error:
"extra keys not allowed @ data[‘entity_id’]. Got ‘switch.AC’ required key not provided @ data[‘trigger’]. Got None