本帖最后由 打酱油 于 2020-6-19 10:58 编辑
#客厅灯
keting_fan_deng:
friendly_name: 客厅灯
value_template: "{% if states('sensor.gonglv_fan1') | int > 30 %} on {% else %} off {% endif %}"
turn_on:
service: broadlink.send
data_template:
host: 192.168.1.10
packet:
- "sgBqASYLJgwNJCcLJgsNJQ0kJgwNwsNAAXcAAAAAAAAAAAAAAAAAAA="
turn_off:
service: broadlink.send
data_template:
host: 192.168.1.10
packet:
- "sgBqASYLJgwNJCcLJgsNJQ0kJgwNJCcLJgsO0kJwsNAAXcAAAAAAAAAAAAAAAAAAA="
帖子我看了,动手能力很强!我是小白就买了小米带电量的插座成品。
1.代码方面service: broadlink.send 我的是小米万能遥控 代码也是这样吗?还是remote.miir
2.host: 192.168.1.10这里是遥控器的还是插座的IP
3.packet:
- "sgBqASYLJgwNJCcLJgsNJQ0kJgwNwsNAAXcAAAAAAAAAAAAAAAAAAA="
这段应该是遥控电源代码是吧
#功耗插座代码
- platform: xiaomi_miio
name: '功耗'
host: 192.168.1.103
token: 6f0a3ac540279d318c097fbe92e8d405
model: chuangmi.plug.v3
#热水器开关反馈
- platform: template
switches:
bedroomheater:
friendly_name: "热水器"
value_template: "{{ as_timestamp(states.script.close_bedroom_heater.attributes.last_triggered) | int < as_timestamp(states.script.open_bedroom_heater.attributes.last_triggered) | int }} "
turn_on:
service: script.open_bedroom_heater
turn_off:
service: script.close_bedroom_heater
麻烦帮我整理下,给我思路我也不太会写,多谢大佬!祝大佬越来越大!
|