Hey all! I hope I’m not trying to solve the wrong problem here. Here goes
I am writing a python script where I am making decisions about what to do with a device’s entity based on one of its other entity’s states.
I’m basically making a power shedding setup. If my total current is above X, then I want to check each of my relays’ current at the moment and turn one or more of them off until the current is below a threshold. Each relay is a separate esphome device with a current sensor, a relay, and some other entities.
I think what I want to do is this:
Given {current_sensor_id}, get the state. If total current > threshold, get the device for {current_sensor_id}.
Look at all entities for the device, and find the relay switch. Turn it off.
I see that helpers can do some of this, but it appears they are not accessible from within python scripts.
If there is a better way to do this (preferably without doing string substitution on Ids,) I’m all ears. This is just how I decided to approach it