什么值得捡——Govee中枢刷入ESPHOME
一、前言
上文说到捡到了廉价的外贸中枢网关+门磁传感器,由于中枢是esp8266方案的,故想研究一个刷入ESPHOME的方法
上文传送门:https://post.smzdm.com/p/azzvx05n/
二、开刷
esp8266的IO0连接到了按钮,对应的是信号图标的那个按键,实际上两个都按下就解决了,串口已经在板子上注明,找个串口模块就可以开刷了


三、配置文件
esphome:
name: govee_service
friendly_name: Govee Service
esp8266:
board: esp01_1m
framework:
version: recommended
logger:
level: INFO
api:
encryption:
key: !secret api_password
ota:
- platform: esphome
password: !secret esphome_ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
output_power: 10db
power_save_mode: HIGH
ap:
ssid: "Govee_Fallback"
password: "12345678"
captive_portal:
web_server:
port: 80
version: 3
binary_sensor:
- platform: gpio
name: "GPIO0 Switch"
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: true
- platform: gpio
name: "GPIO2 Switch"
pin:
number: GPIO2
mode: INPUT_PULLUP
inverted: true
on_press:
- switch.toggle: blue_led
switch:
- platform: gpio
id: red_led
name: "Red LED"
pin: GPIO4
restore_mode: ALWAYS_OFF
- platform: gpio
id: blue_led
name: "Blue LED"
pin: GPIO5
restore_mode: ALWAYS_OFF
remote_receiver:
pin:
number: GPIO12
mode:
input: true
pullup: true
dump:
- rc_switch
tolerance: 50% # 从 85% 大幅降低
filter: 200us # 提高最小脉宽
idle: 7ms # 拉长帧间隔
# 定时任务
interval:
- interval: 500ms
then:
if:
condition:
wifi.connected: # 检查 Wi-Fi 是否连接
then:
- switch.turn_off: red_led
- switch.turn_on: blue_led
else:
- switch.turn_on: red_led
- switch.turn_off: blue_led
四、实际使用
目前使用的是通过读取RC_SWITCH的方式解码的

五、注意事项
Govee的编码方式有点复杂,个人精力有限不太想做解析,直接使用了RCSWITCH的解码库,所以读取到的RAW值可能比较奇怪

433Mhz频段上的干扰较大,实际用逻辑分析仪抓取波形,可以看到有一个repeat80次的信号,但是其他的杂波和这个信号的频率接近,如果直接读取RAW会疯狂滚动乱码

期待有UU能做协议的解析~
作者声明本文无利益相关,欢迎值友理性交流,和谐讨论~

值友1694981817
校验提示文案
值友1694981817
校验提示文案