9
113
1090
论坛DIY达人
使用道具 举报
196
1681
金牌会员
tangyali 发表于 2023-2-8 16:14 可以吧,我在delay可以使用变量,这个理论上也应该没问题
cmsj 发表于 2023-2-8 20:40 能否示例?感谢
#定义number模板,用于hass交互设定设定变量值: number: - platform: template name: "${device_name} Close Timer" id: close_timer icon: mdi:timer optimistic: true restore_value: true min_value: 80 max_value: 120 step: 2 on_value: then: - globals.set: id: cd_timer value: !lambda "return x * 1000;"
#-------------------------全局变量---------------------------------------------# globals: - id: cd_timer type: int restore_value: yes
number: - platform: template # ... on_value_range: above: !lambda "return id(cd_timer);" below: 10 then: - switch.turn_on: relay_1
查看全部评分
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )
GMT+8, 2025-5-19 00:28 , Processed in 0.599556 second(s), 28 queries .
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.