Created
December 8, 2017 02:21
-
-
Save willwhui/b4a365416881f3dc4a26bbeeea49ec7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
利用人体感应器制作一个提醒休息的工具 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
示例
设置一个input_number作为计数器
实际使用的时候,每分钟+1
注意,initial千万不要设置,否则每次重启的时候都会被设置为这个初始值。第一次启用这个number的时候,系统会将它设置为0
设置一个input_boolean作为flag
便于通过Alexa语音控制,也是一个显式的标记。
同时也是一个被automation触发器监视的状态点。
启动
initial_state: true
#hide_entity: true
trigger:
entity_id: input_boolean.start_work
to: 'on'
condition:
condition: and
conditions:
entity_id: input_number.start_work_timer
below: 1 # less than 1 means no working timer now
entity_id: automation.tts_for_take_a_walk_repeating
state: 'off' # no repeating tts means no working timer now
action:
data:
entity_id: input_number.start_work_timer
value: 1 # inital start value
entity_id: automation.set_working_timer_by_motion_counting
entity_id: !secret current_media_player_id
entity_id: !secret current_media_player_id
data:
message: "A start work timer started!"