Hey, after installing the energy monitor I noticed that values don’t update, only Total Energy is updating, leakage current voltage current and power have the same value since day 1
flashed the mcu with the latest esphome
I noticed also that my pcb is a little bit different from the device used here TOMZN TOMPD-63-WiFi | ESPHome Devices
esphome:
name: tompd-cbu
friendly_name: tompd-cbu
bk72xx:
board: generic-bk7231n-qfn32-tuya
#board: wb3s
ota:
- platform: esphome
password: "0b8b2bf7c9fe6f9a9bd8a6913b693b72"
api:
encryption:
key: "K6VTuysbvkk8clKXDC91dNoUaRobo0IJmk5N3b6fDY4="
# Enable Home Assistant API
# Disable logging
logger:
baud_rate: 0
uart:
baud_rate: 9600
id: uart_tuya
rx_pin: RX1
tx_pin: TX1
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.3.68
gateway: 192.168.3.1
subnet: 255.255.0.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "tom Fallback Hotspot"
password: "idEqhSV1Hafg"
tuya:
uart_id: uart_tuya
on_datapoint_update:
- sensor_datapoint: 6
datapoint_type: raw
then:
- lambda: |-
ESP_LOGD("main", "on_datapoint_update %s", format_hex_pretty(x).c_str());
id(voltage).publish_state((x[0] << 8 | x[1]) * 0.1);
id(current).publish_state((x[3] << 8 | x[4]) * 0.001);
id(power).publish_state((x[6] << 8 | x[7]) * 1);
switch:
- platform: tuya
switch_datapoint: 16
name: "On"
sensor:
- platform: template
id: voltage
name: "Volt"
unit_of_measurement: "V"
icon: "mdi:sine-wave"
accuracy_decimals: 1
- platform: template
id: current
name: "Curent"
icon: "mdi:current-ac"
unit_of_measurement: "A"
accuracy_decimals: 2
- platform: template
id: power
name: "Power"
icon: "mdi:flash"
unit_of_measurement: "W"
accuracy_decimals: 0
- platform: tuya
name: "Total Energy"
sensor_datapoint: 1
unit_of_measurement: "kWh"
accuracy_decimals: 2
icon: "mdi:lightning-bolt"
filters:
- multiply: 0.01
- platform: tuya
name: "Leakage Current"
sensor_datapoint: 15
unit_of_measurement: "mA"
accuracy_decimals: 0
icon: "mdi:flash-alert"
from the log I can get this maybe it can help
[10:36:49.237][C][tuya:056]: Datapoint 16: switch (value: ON)
[10:36:49.241][C][tuya:060]: Datapoint 19: string value (value: 1234)
[10:36:49.244][C][tuya:054]: Datapoint 17: raw (value: 04.01.00.1E)
[10:36:49.246][C][tuya:054]: Datapoint 18: raw (value: 01.01.00.28.03.01.00.F5.04.01.00.D2 (12))
[10:36:49.251][C][tuya:058]: Datapoint 1: int value (value: 1030)
[10:36:49.255][C][tuya:058]: Datapoint 15: int value (value: 0)
[10:36:49.258][C][tuya:054]: Datapoint 6: raw (value: 09.06.00.06.E0.00.01.29 (8))
[10:36:49.262][C][tuya:058]: Datapoint 104: int value (value: 800)
[10:36:49.266][C][tuya:058]: Datapoint 105: int value (value: 500)
[10:36:49.270][C][tuya:058]: Datapoint 116: int value (value: 2317)
[10:36:49.273][C][tuya:058]: Datapoint 117: int value (value: 1960)
[10:36:49.277][C][tuya:058]: Datapoint 118: int value (value: 362)
[10:36:49.280][C][tuya:056]: Datapoint 11: switch (value: OFF)
[10:36:49.284][C][tuya:058]: Datapoint 13: int value (value: 0)
[10:36:49.287][C][tuya:064]: Datapoint 9: bitmask (value: 0)
[10:36:49.292][C][tuya:074]: Product: '{"P":"u0cxoxtfelys3ufx","v":"1.0.0","m":1,"mt":10,"n":0,"low":0}'