получилось сегодня освободить розетку и прошить. спасибо за фото и гайды.
полностью можно не разбирать, достаточно отщелкнуть половинку и можно подпаяться к wi-fi плате. питание на входной конденсатор. шил через ltchiptool.

в yaml указал почти всё, как у @Sonic_Amiga
Нажмите, чтобы открыть спойлер
|
Код:
|
# https://kazus.run/forums/showpost.php?p=1396708&postcount=10
# YNDX-0007 Smart Socket
substitutions:
device_name: "yndx-0007" # Unique per device!
esphome:
name: ${device_name}
friendly_name: YNDX0007
rtl87xx:
board: wr2
# Enable logging
logger:
# Enable Home Assistant API
#api:
# encryption:
# key: ""
#ota:
# - platform: esphome
# password: ""
captive_portal:
web_server:
port: 80
auth:
username: webuser
password: webpass
wifi:
# ssid: !secret wifi_ssid
# password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name} Fallback Hotspot"
password: ""
switch:
- platform: gpio
name: "Relay"
pin: PA00
id: relay
restore_mode: RESTORE_DEFAULT_OFF
output:
- platform: gpio
id: led_blue
pin:
number: PA23
inverted: true
binary_sensor:
- platform: gpio
pin:
number: PA18
inverted: true
mode:
input: true
pullup: false
filters:
- delayed_off: 10ms
name: "Button"
on_click:
- switch.toggle: relay
# blink led if wifi is not connected
interval:
- interval: 1s
then:
if:
condition:
wifi.connected:
then:
- output.turn_off: led_blue
else:
- output.turn_on: led_blue
- delay: 500ms
- output.turn_off: led_blue
- delay: 500ms
sensor:
- platform: hlw8012
model: BL0937
# Resistor values are 2M and 1K, however this value gives readings significantly higher than normal
# I calibrated this value using my official (used for billing) energy meter readings as a reference
# voltage_divider: 2001
voltage_divider: 1790
sel_pin:
number: PA15
inverted: true
cf_pin:
number: PA05
inverted: true
cf1_pin:
number: PA12
inverted: true
current:
name: "Current"
voltage:
name: "Voltage"
power:
name: "Power"
energy:
name: "Energy"
update_interval: 5s
change_mode_every: 4 |
в архиве прошивка, которая сразу падает в Fallback, чтоб по OTA обновить на свою.
p.s. уже после интеграции заметил, что значения по току-напряжению были 0. после пары экспериментов выяснил, что в моей розетке не надо cf и cf1 инвертировать.