2
158
2698
金牌会员
使用道具 举报
13
487
3468
论坛元老
yuqiuyi99 发表于 2019-4-4 13:09 看官网例子,有个例子是积累戒烟时间的,秒数转换到几天几小时几分
27
2129
9171
情非殇 发表于 2019-4-4 17:56 用counter计数器计数,日期每次变化,计数器+1,累计到18时执行动作,累计到19时清零,然后该是20的时候就 ...
opalhair 发表于 2019-4-4 20:57 谢谢。要好好研究研究,希望可以
counter: test: name: '计数器' initial: 0 step: 1 automation: - alias: test1 trigger: - platform: state entity_id: sensor.date action: # +1 - service: counter.increment entity_id: counter.test - alias: test2 trigger: - platform: state entity_id: counter.test to: '18' action: # 触发动作 - alias: test3 trigger: - platform: state entity_id: counter.test to: '19' action: # 复位计数器 - service: counter.reset entity_id: counter.test_0311
情非殇 发表于 2019-4-4 21:32 万物皆可计数 [code]counter: test:
8
863
5240
opalhair 发表于 2019-4-4 22:00 非常感谢!我搜到你之前写的实例,跟着改了一下,复位前增加了一个关闭的 action,等墙壁插座安装以后就 ...
情非殇 发表于 2019-4-5 21:06 可以做个script的+1,和-1 的service,用来手动微调,增加容错性
本版积分规则 发表回复 回帖后跳转到最后一页
为论坛做出突出贡献的会员
Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )
GMT+8, 2025-6-24 07:53 , Processed in 0.152782 second(s), 23 queries .
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.