Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- automation:
- - id: get_text_to_cmd
- alias: get_text_to_cmd
- description: "擷取文字轉成指令"
- trigger:
- - platform: state
- entity_id: input_text.some_sentence
- from: " "
- not_to: " "
- condition: []
- action:
- - variables:
- line_cmd: >
- {% if "小愛同學" in states("input_text.some_sentence") -%}
- {{ states("input_text.some_sentence")[4:] }}
- {%- endif %}
- - choose:
- - alias: "關陽台燈"
- conditions:
- - condition: template
- value_template: "{{ line_cmd == '關陽台燈' }}"
- sequence:
- - service: switch.turn_off
- target:
- entity_id: switch.balcony_light
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement