3
68
727
高级会员
{% set relative_time = (states.input_slider.alarmhour.state|float|multiply(60) + states.input_slider.alarmminutes.state|float) + (now().hour|float|multiply(60) + now().minute|float) %}[/size] {%- if relative_time > 1440 -%} {{((relative_time-1920) |int |multiply(60)) | timestamp_custom("%H:%M")}} {%- else -%} {{((relative_time-480) |int |multiply(60)) | timestamp_custom("%H:%M")}} {%- endif %}
timer.yaml
2017-11-23 12:49 上传
点击文件名下载附件
2.33 KB, 下载次数: 61
查看全部评分
使用道具 举报
27
154
1404
金牌会员
只发干货
holala 发表于 2017-11-23 22:56 HA0.57之后出了一个timer组件,可以很简单的实现计时功能了 https://home-assistant.io/components/timer/ ...
5
140
448
中级会员
4
215
493
15
656
2833
12
91
724
本版积分规则 发表回复 回帖后跳转到最后一页
教程高产大神,简直就是为了教程而生~
在众坛友心目中具有较高技术与威望,为社区繁荣作出重要贡献
Archiver|手机版|小黑屋|Hassbian
GMT+8, 2025-3-18 18:16 , Processed in 0.137877 second(s), 35 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.