本帖最后由 sorrypqa 于 2025-8-30 11:52 编辑
南方的夏天,风扇和空调这两玩意简直是救命神器,对于这些使用率比较高的电器,我比较在乎能效比,自从买到直流变频风扇,习惯性测试了一下耗电量,我的乖乖,1-20W之间,对比普通交流电机的风扇的15-47W,按照我的使用频率,一年可以节省几十度电呀!于是立马把家里的普通交流电机风扇全搬到废品站处理了,从此都没正眼看过一次,不过这款风扇原配的控制板和遥控实在是太难用了,2023年学DIY时照猫画虎做了第一版,用起来还算可以,不知怎么嘀让汕头大佬看中,被“横刀夺爱”了,风扇没了主板咋办?虽然现在没了DIY的兴趣,但为了夏天不被热S,还是要硬着头皮再做出来,顺便在原来的基础上修改了一下。
功能以下:
1、由原版3档变速改为10档变速,虽然可以配置更多的档位,但意义不大。
2、由原来的指向性的红外遥控改为射频无线和蓝牙等多种遥控,直连通信,无需网络和HA也可以控制风扇。
3、内置433M和315M 2种射频网关,
能直接把收到的任意固定码315遥控和433遥控的按键信号转为不同遥控码通过实体直接提供给HA,可以在HA的自动化里控制任意设备,
能把任意的315M和433M无线红外传感器、门磁传感器等设备接入,与ESPHome或者HA里自动化联动。
也可以同时发射任意的315M和433M指令。
4、内置离线语音控制,无需网络也可以直接通过语音命令直接控制风扇所有动作,同时也可以通过HA的自动化来控制HA里的其它任意设备。
5、内置光照度传感器,自动化照明必备神器。
6、内置温度、湿度传感器,用来实现根据温度自动调整风扇速度。
7、内置人体传感器接口,如需要实现有人、并且室温大于26度时自动打开风扇,无人自动关,可以装上。
8、考虑到有时会用电池供电,所以内置电压、电流、功率检测,必要时通过主板蜂鸣器或者ASR的喇叭提醒电池电量,也可以低电量时自动关闭风扇。
自从用了这个功率传感器,发现个新大陆,就是风扇罩和风扇叶脏了的话,风扇的最高耗电会增加3w,清理干净会恢复正常。
9、内置勿扰模式,并能在设备端设置任意时段自动开启或关闭,开启时会自动关闭所有状态指示灯,以免光污染。
10、拥有RS485接口,可以作为服务端或客户端用来读取或者控制其它485通讯的设备
11、停电时支持外接电池供电
一般会根据风扇的安装位置增减某些功能
壁挂风扇,不占地面面积:
风扇原配主板:
缺点:档位少,只有3个档,1档是废的,有时用起来3档嫌大、2档嫌小,并且遥控非常难用,要对准,并且按10次可能只有3次生效,反正我是忍无可忍!
这是新改的主板:
这是焊接好的主板:
客厅那台风扇由于靠近电表,所以利用它的485接口来读取电表的数据
这样不但节省一个电表专用的485控制器,还能节省它的待机耗电:
改装后的功能与原版的变化:
目前为这主板配了下图这2款遥控器,左边的是433M射频遥控,可以控制风扇开、关,直选风速、摇摆控制,多余的按键用来控制HA里其它设备。右边的是平头熊的蓝牙遥控,单击控制开和关,双击控制摇摆、三击循环调整风速,长按时最高速度
蓝牙遥控用的是ryanh7大佬的,直连通信,利用内部自动化直接执行动作,无需网络和HA:
xiaomi_remote:
- mac_address: A4:C1:38:28:F2:65
battery_level: # 电池电量
name: "PTX05 电池电量"
icon: mdi:battery-90-bluetooth #自定义图标
web_server:
sorting_group_id: sorting_group_sensor
# press: # 二进制传感器
# name: PTX05 button binary
# action: # 0:无动作 1:单击 2:双击 3:三击 99:长按
# name: ${name} PTX02 button action
# action_text: # Idle:无动作 Click:单击 Double-click:双击 Triple-click:三击 Long press:长按
# name: "K1.PTX05 蓝牙遥控"
# icon: mdi:bluetooth-audio #自定义图标
on_click: # 单击示例
then:
- logger.log: "单击"
- fan.toggle: "Variable_speed_fan"
- button.press: "frequency_button"
on_double_click: # 双击示例
then:
- logger.log: "双击"
- if:
condition:
- lambda: 'return id(Variable_speed_fan).state ;'
then:
- if:
condition:
- lambda: 'return id(Variable_speed_fan).oscillating ==0;'
then:
- lambda:
auto call = id(Variable_speed_fan).turn_on();
call.set_oscillating(true);
call.perform();
else:
- lambda:
auto call = id(Variable_speed_fan).turn_on();
call.set_oscillating(false);
call.perform();
- button.press: "frequency_button"
on_triple_click: # 三击示例
then:
- logger.log: "三击"
- fan.cycle_speed: #切换风扇速度
id: Variable_speed_fan
off_speed_cycle: false #确定风扇在循环达到最高速度后是否会循环关闭。可选true、false
- button.press: "frequency_button"
on_long_press: # 长按示例
then:
- logger.log: "长按"
- fan.turn_on:
id: "Variable_speed_fan"
speed: 10
- button.press: "frequency_button"
离线语音控制模块的指令通过uartex外部扩展组件提取并执行
external_components:
- source: components
components: [ xiaomi_remote ]
- source: components
components: [ uartex ]
uartex:
rx_footer: "\r" # Termination character
uart_id: "asrpro_uart"
text_sensor:
- platform: uartex
id: "uart_readline"
lambda: |-
return std::string(reinterpret_cast<const char*>(data), len);
name: "语音控制ASRPRO"
离线语音控制除了能直控风扇所有动作,还能通过一条自动化来控制HA里的任意设备,下面是自动化的参考配置:
alias: 语音控制(fan01)
description: ""
triggers:
- entity_id:
- sensor.sezze_fan_01_asrpro
trigger: state
conditions: []
actions:
- parallel:
- alias: 开灯
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: light:on
- condition: device
type: is_off
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 4805ecd56837e467a393f623df30ee8c
domain: switch
then:
- type: turn_on
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 4805ecd56837e467a393f623df30ee8c
domain: switch
- alias: 关灯
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: light:off
- condition: device
type: is_on
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 4805ecd56837e467a393f623df30ee8c
domain: switch
then:
- type: turn_off
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 4805ecd56837e467a393f623df30ee8c
domain: switch
- alias: 播放音乐
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: music:play
then:
- target:
entity_id: media_player.wo_shi
data: {}
action: media_player.media_play
- alias: 暂停音乐
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: music:pause
then:
- target:
entity_id:
- media_player.wo_shi
data: {}
action: media_player.media_pause
- alias: 换一首歌
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: music:next
then:
- target:
entity_id:
- media_player.wo_shi
data: {}
action: media_player.media_next_track
- alias: 离家模式
if:
- condition: state
entity_id: sensor.esp32_ks6b3r_15_asrpro
state: Home:off
then:
- type: turn_off
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 4805ecd56837e467a393f623df30ee8c
domain: switch
- type: turn_off
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 123634fd7966670ce9b997e535726123
domain: switch
- type: turn_off
device_id: 4dc2635ad882c3c9055dad2ee9779558
entity_id: c05b17c90bc19f4a9381a21e1a9fa6e5
domain: switch
- alias: 在家模式
if:
- condition: state
entity_id: sensor.esp32_ks6b3r_15_asrpro
state: Home:on
then:
- type: turn_on
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 4805ecd56837e467a393f623df30ee8c
domain: switch
- type: turn_on
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 123634fd7966670ce9b997e535726123
domain: switch
- type: turn_on
device_id: 4dc2635ad882c3c9055dad2ee9779558
entity_id: c05b17c90bc19f4a9381a21e1a9fa6e5
domain: switch
- alias: 打开服务器
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: server:on
- condition: device
type: is_off
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 743dd069fedf6e11a6c66266236f3586
domain: switch
then:
- type: turn_on
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 743dd069fedf6e11a6c66266236f3586
domain: switch
- alias: 关闭服务器
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: server:off
- condition: device
type: is_on
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 743dd069fedf6e11a6c66266236f3586
domain: switch
then:
- type: turn_off
device_id: 3df6590ce2eecef03929ce4e1ef75046
entity_id: 743dd069fedf6e11a6c66266236f3586
domain: switch
- alias: 打开电脑
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: computer:on
then:
- metadata: {}
data: {}
target:
entity_id: switch.hpbook
action: switch.turn_on
- alias: 关闭电脑
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: computer:off
then:
- metadata: {}
data: {}
target:
entity_id: switch.hpbook
action: switch.turn_off
- alias: 打开热水器
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: heater:on
- condition: time
after: "08:00:00"
before: "22:00:00"
then:
- metadata: {}
data: {}
target:
entity_id: switch.re_shui_qi
action: switch.turn_on
- alias: 关闭热水器
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: heater:off
then:
- target:
entity_id:
- switch.re_shui_qi
data: {}
action: switch.turn_off
- alias: 打开充电器
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: charger:on
then:
- metadata: {}
data: {}
action: switch.turn_on
target:
entity_id: switch.sonoff_dualr3_03_a1_1
- alias: 关闭充电器
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: charger:off
then:
- data: {}
action: switch.turn_off
target:
entity_id: switch.sonoff_dualr3_03_a1_1
- alias: 离家模式
if:
- condition: state
entity_id: sensor.sezze_fan_01_asrpro
state: home:off
then:
- parallel:
- data: {}
action: switch.turn_off
target:
entity_id: switch.huntkey_ch416a_02_a1_kai_guan_1
- action: media_player.media_pause
metadata: {}
data: {}
target:
entity_id: media_player.wo_shi
- if:
- condition: state
entity_id: fan.sezze_fan_01_a1_bian_pin_feng_shan
state: "on"
then:
- action: fan.turn_off
metadata: {}
data: {}
target:
entity_id: fan.sezze_fan_01_a1_bian_pin_feng_shan
mode: single
风扇的自动调速功能本来想集成的风扇固件里,但测试时不太方便,为了方便调整,就暂时使用HA的自动化来根据室温来自动控制风扇速度,这样一年四季都不用理会风扇的档位。
下面是HA的自动化的执行部分,触发和条件可以用下面3种:
1、风扇每次启动时触发,条件是温度大于26°
2、室内温度变化时触发,条件是风扇是打开状态并且温度大于26°
3、检测到有人时触发,条件是室内温度大于26°
actions:
- data: {}
action: fan.turn_on
target:
entity_id: fan.sezze_fan_01_a1
- data:
percentage: >
{% if states("sensor.daikin_air_01_temperature")|float >= 26 and
states("sensor.daikin_air_01_temperature")|float < 27 %} 10 {% elif
states("sensor.daikin_air_01_temperature")|float >= 27 and
states("sensor.daikin_air_01_temperature")|float < 28 %} 20 {% elif
states("sensor.daikin_air_01_temperature")|float >= 28 and
states("sensor.daikin_air_01_temperature")|float < 29 %} 40 {% elif
states("sensor.daikin_air_01_temperature")|float >= 29 and
states("sensor.daikin_air_01_temperature")|float < 30 %} 60 {% elif
states("sensor.daikin_air_01_temperature")|float >= 30 and
states("sensor.daikin_air_01_temperature")|float < 31 %} 80 {% else %}
100 {% endif %}
target:
entity_id: fan.sezze_fan_01_a1
action: fan.set_percentage
风扇语音控制模块源码,下载天问Block并安装,打开此源码,根据自己的需求更改里面的唤醒词和命令词,生成模型并编译成固件刷入ASRPRO就OK!
sezze-fan-01 语音控制模块源码.hd
(153.95 KB, 下载次数: 0, 售价: 10 金钱)
中国移动这破网络!又无法正常编辑了......
刷入固件、通电后,风扇的wifi状态指示灯会快闪并发射一个“sezze-fan-xx”的配网AP,手机连接此AP并用手机浏览器打开192.168.4.1,在配网界面里会显示出扫描到的所有WiFi,选中要连接的WiFi输入密码,保存后风扇的wifi状态指示灯变为呼吸慢闪,代表已经连接网络,HA会自动发现设备,点添加设备就可以使用了。
|