You no longer need either the input_boolean
, or the template binary sensor. You’ll use python_script.set_state
to (effectively) create binary_sensor.skylink_side_door
.
If this doesn’t make sense, then you should probably give Home Assistant Architecure a read, especially the diagram at the bottom of the page labeled “Home Assistant Core Architecture.”
python_script.set_state
is writing directly to the State Machine. You don’t need any actual components. Pretty much everything in HA (frontend, services, etc.) interacts with the State Machine via the Event Bus. If you write something to the State Machine directly, it’s the same as if a component did it. BTW, when you change the state of an “entity” at the top of the STATES tab on the Developer Tools page, that’s what you’re doing – i.e., writing directly to the State Machine. That’s why it says, “Set the representation of a device within Home Assistant. This will not communicate with the actual device.”
That’s one way to do it. But if you do, you should also specify the friendly_name
, icon
& device_class
attributes.
A better way might be to define a new action
, and then specify only what’s unique about that particular applet. Then write a new automation that listens for that action
and pulls out the details it needs from the event data, and then fills in the rest (that doesn’t change) in the call to python_script.set_state
.