本帖最后由 wx13338120950 于 2018-10-8 12:18 编辑
前文:去亲戚加住了两天,亲戚家是新买的房子,新装修卫生间装的浴霸有自动沐浴功能(其实就是恒温,温度低于多少度启动暖风机,高于多少度关闭暖风机,起到舒适节能的目的)。 我们几天就把家里普通的浴霸硬改一下成为智能浴霸,我先介绍一下我家的浴霸,我的家的浴霸是由5个部分组成(照明、换气、吹风、加热片1、加热片2)总共有5个开关,因为我们后面要实现自动沐浴,我就把两个暖风机的控制端接在一起,这样就只有4个开关了。
我家的浴霸
下面准备材料(1、论坛三开改装模块一个(用于接照明,换气,吹风这些低功率识备);2、论坛一开改装模块一个(用于墙壁开关启动自动沐浴自动化的触发,只需要一个开关状态,模块输出端悬空);3、sonoffbasic一个(刷好tasm固件,接两路加热片,再接一个DHT温湿度传感器)4、4开86开关一个、导线和胶布及其他你自己需要的部件。
接下来就是接线整合了,加ha配置了,这些论坛里都有教程的。
附上我的自动沐浴自动化(我是照葫芦画瓢的,我感觉我写的应该还能再整合优化一下,希望有大神帮我修改一下):
#自动沐浴(启动加关闭)
#启动
- alias: auto_xizhao
initial_state: true
hide_entity: false
trigger:
- platform: state
entity_id: switch.auto_bath
from: 'off'
to: 'on'
action:
- service: automation.turn_on
entity_id: automation.auto_on
- service: automation.turn_on
entity_id: automation.auto_off
#安全设置(开加热片,必须开启吹风)
- alias: auto_111
initial_state: true
hide_entity: false
trigger:
- platform: state
entity_id: switch.bath_heater1
from: 'off'
to: 'on'
action:
- service: switch.turn_on
entity_id: switch.bathroom_fan
#安全设置(关闭加热片,吹风延时15秒关闭)
- alias: auto_11111
initial_state: true
hide_entity: false
trigger:
- platform: state
entity_id: switch.bath_heater1
from: 'on'
to: 'off'
action:
- delay:
seconds: 15
- service: switch.turn_off
entity_id: switch.bathroom_fan
#温度低于设定值(28)开始启动暖风
- alias: auto_on
initial_state: false
hide_entity: false
trigger:
- platform: numeric_state
entity_id: sensor.bathroom_tem
below: 28
action:
- service: switch.turn_on
entity_id: switch.bath_heater1
#温度高于设定值(30)关闭暖风
- alias: auto_off
initial_state: false
hide_entity: false
trigger:
- platform: numeric_state
entity_id: sensor.bathroom_tem
above: 30
action:
- service: switch.turn_off
entity_id: switch.bath_heater1
#退出自动沐浴(关闭自动沐浴自动化)
- alias: auto_xizhao_off
initial_state: true
hide_entity: false
trigger:
- platform: state
entity_id: switch.auto_bath
from: 'on'
to: 'off'
action:
- service: automation.turn_off
entity_id: automation.auto_on
- service: automation.turn_off
entity_id: automation.auto_off
#退出自动沐浴(关闭设备)
- alias: auto_xizhao_off_shebei
initial_state: true
hide_entity: false
trigger:
- platform: state
entity_id: switch.auto_bath
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: switch.bath_heater1
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.bath_heater1
homekit
本文就此结束,如有不对的地方,请大神们多多指教。
|