3
87
367
中级会员
sensor: - platform: template sensors: naozhong: friendly_name: '闹钟时间' value_template: '{{ "%0.02d:%0.02d" | format(states("input_number.hour") | int, states("input_number.min") | int) }}'
sensor: - platform: template sensors: naozhong: friendly_name: '闹钟修改' value_template: '{{ "%0.02d:%0.02d" | format(states("input_number.hour") | int, (states("input_number.min")) - 2 | int) }}'
使用道具 举报
6
743
5956
论坛元老
sensor: - platform: template sensors: naozhong: friendly_name: '闹钟修改' value_template: '{{(((states("input_number.hour")|int)*60+(states("input_number.min")|int)-2 )*60)|timestamp_custom('%H:%M', False)}}'
mitu 发表于 2019-11-20 15:33
mitu 发表于 2019-11-20 15:45 另外,为什么不用input_datetime,非要用两个input_number呢?
leaion 发表于 2019-11-21 20:44 配置无效 Error loading /home/homeassistant/.homeassistant/configuration.yaml: while scanning for t ...
mitu 发表于 2019-11-21 23:01 我这儿测试了,没毛病,你再看看你的配置。
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|Hassbian
GMT+8, 2024-11-25 14:59 , Processed in 0.065998 second(s), 33 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.