本帖最后由 情非殇 于 2019-3-22 20:50 编辑
调整一下排序,把拉杆做到灯下面就好了呀https://bbs.hassbian.com/thread-4855-1-1.html这种效果
homeassistant:
customize:
input_number.timer_min:
friendly_name: 分
icon: mdi:av-timer
sensor:
- platform: template
sensors:
timer_setting:
friendly_name: 'Time'
value_template: '{{ "%0.02d:%0.02d:%0.02d" | format(states("input_number.timer_hour") | int, states("input_number.timer_min") | int, states("input_number.timer_sec") | int) }}'
input_number:
timer_min:
name: TimerMinute
min: 0
max: 100
step: 1
timer:
timer:
duration: '00:00:00'
automation:
- alias: test1
hide_entity: true
trigger:
- platform: state
entity_id: sensor.timer_setting
action:
- service: timer.cancel
entity_id: timer.timer
- service: timer.start
data_template:
entity_id: timer.timer
duration: >
{{ states("sensor.timer_setting") }}
- alias: test2
hide_entity: true
trigger:
platform: event
event_type: timer.finished
event_data:
entity_id: timer.timer
action:
- service: homeassistant.turn_on
entity_id: switch.xxxx
|