I made a card showing the selections. Now i actually want to change the mode of a purifier by selecting options from the dropdown list. For example: select Living, Auto and the purifier should go in auto mode.
The service to control the purifier is:
fan.set_speed with the entities: fan.air_purifier_birou ; fan.air_purifier_living and fan.air_purifier_bedroom.
Now i get to the part where i am lostā¦ i have added the following in automations.yaml
- alias: Air Purifiers Selector
trigger:
- platform: state
entity_id: input_select.air_purifier
- platform: state
entity_id: input_select.purifier_mode
action:
- service: fan.set_speed
data_template:
entity_id: >
{% if is_state("input_select.air_purifier", "Birou") %}
fan.air_purifier_birou.purifier_mode
{% else %}
{% endif %}
But to the OP the problem might be that you donāt have an āelseā value specified.
And you donāt have a speed to tell it what to set it to.
data_template:
entity_id: >
{% if is_state("input_select.air_purifier", "Birou") %}
fan.air_purifier_birou
{% else %}
# something here
{% endif %}
speed: >
# probably a template here to use the state of the input select to determine the speed.
Youāll have to come up with a template for that too probably.
Yes the āspeedā i need to provide is actually a mode, defined in purifier_mode input select. I provided a pic of a service call that works. But how to translate that to the automations ?
If you want different defaults in the case of some unexpected error, change the else values. But make sure all the other values for the option are covered in the if or elif statements.
First Service (changing mode Auto/Fav/Silent) works very well.
However, changing the fan speed reguired another service, which i have added but it does not work. Log shows nothing but it does not do anything.
Any ideeas ? I think it has something to do with the fact that i am calling 2 servicesā¦
As long as the entity IDs all start with fan.air_purifier_ and the input select options match the end of the entity IDs (as youāre already doing) itāll work.
speed: "{{ states('input_select.fan_speed') }}"
As long as the input_select speeds match actual fan speeds that can be set youāll be good here too.
The service: fan.set_speed works but service: xiaomi_miio.fan_set_favorite_level doesn not work.
One has a red line in front, one a blackā¦ What to change
using the build in service call works with xiaomi_miio.fan_set_favorite_level
Pretty soon i will have 1 line of code for my 2 pages awsome
Nowā¦ to take it to the next level Is it possible to have some Accept/Reject buttons on the card and that the changes are applied only if i hit Accept ?