Hello.
How to pass sensor value select_rooms_for_clean to the script
script
clean_select_rooms:
alias: Clean selected
sequence:
- service: xiaomi_miot.call_action
data:
entity_id: vacuum.robot_cleaner
siid: 7
aiid: 3
params:
- states('sensor.select_rooms_for_clean') # there should be a value from the sensor!
- 0 # 0 = 'Global'
- 1 # 1 = 'start'
throw: true # throw result to HA notifications
sensor:
- platform: template
sensors:
select_rooms_for_clean:
value_template: >
{% set dfg = expand('group.all_rooms_for_vac_clean') | selectattr('state', 'eq', 'on')
| map(attribute='entity_id') | list | join(',')
| replace('input_boolean.bedroom_vacuum','14')
| replace('input_boolean.kinozal_vacuum','12')
| replace('input_boolean.hallway_vacuum','17')
| replace('input_boolean.cabinet_vacuum','10')
| replace('input_boolean.kitchen_vacuum','11') %}
{{dfg}}
friendly_name: "Rooms"
icon_template: mdi:vacuum