I’ve been using HA with node-red for a few months now and have a few basic flows set up, but I’m trying to wrap my head around the best way to do this one:
Trigger (door sensor) --> poll status of 2 people (wife and I) —> the possible outcomes HH AA HA (H-Home A-Away) based on the outcome of this I have three different things I want to happen. What is the best way to set up the first part of this flow? I’m thinking have my EVENT STATE trigger the flow followed by two separate CURRENT STATE nodes for my wife and I. After that I’d assume a SWITCH node would work but not sure how to configure the two payloads into possible switch outputs.
Set the state location for the two current state nodes to something like wife and husband. Then in the switch node do 3 different JSOnata expressions with something like
husband = "home" and wife = "home" husband = "away" and wife = "away" husband = "home" and wife = "away"