Right now I have an app that uses a dictionary to determine what target entities to turn on/off based on a trigger entity being turned on or off. I’m being vague because triggers aren’t always switches, or light’s, sometimes they are media_players, input_booleans, or binary_sensors.
It all works pretty well. When I open the door to my office, the office_door trigger is found and as a results of it being opened, it turns on the lights in my office. When the door is closed, based on the same rule, but in response to the close state, it turns off the lights.
Now though, I want to make it react to non on/off triggers, like a trigger based on temperature range. To do this I’m thinking about switching from the on/off paradigm to a pass/fail or true/false paradigm. But then I need to be able to have python either execute a comparison embedded in the dictionary, or possibly execute an external (but still in AD) application.
What would be the best way to approach that?