You use the call service node in node red to turn things on and off. You use current state to fetch if something is off or on or some other property you are looking for. You can use things like event state or inject nodes to kick of or trigger automations. You use debug to see what properties are available. Wait until or stoptimers hold automations until something else happens or time elapses. Switches route functions of automations. The list goes on, but anything is possible. Once you get fluent, it’s not hard at all.