tsunglung / hass_humidifier_template

Home Assistant Humidifier Template
MIT License
7 stars 1 forks source link

How to setup action of device state? #2

Open ch155260 opened 2 months ago

ch155260 commented 2 months ago

Follow Readme to setup device of dehumidifier, can't setting the device status to on or off, I think this issue is device state didn't have code of state_action in configuration, only have code to get state from device. 未命名 未命名

mag1024 commented 1 month ago

I was puzzled by this as well, but looking at the code, it is possible to give the template a switch_id parameter for an entity to toggle on/off when the state is changed. With this it is possible to create a template switch to do what you want. Of course, having a built-in set_state_action hooks would be preferable :)