KinDR007 / VictronMPPT-ESPHOME

Victron Mppt charger ve.direct to esphome node
MIT License
267 stars 59 forks source link

Component esphome.coroutine took a long time for an operation --> Timing issue?!? #153

Closed donaldstod closed 1 month ago

donaldstod commented 3 months ago

Hello,

I have been running this code "Victron-MPPT-ve.direct-to-MQTT"on an ESP8266 for months without any errors. HW ESP8266 with a 5V to 3.3V level shifter and the standard pin configuration. After an electrical overstress of the power supply of the ESP8266, it died. After that I saw the new "VictronMPPT ESPHOME" code switched to the ESPHOME version and ever since I never got a complete message from the microcontrollers. I have the code in two setups with different HW both have the same issue. Setup 1: ESP32 with direct connection to the Victron MPPT Setup 2: ESP8266 with connection through level shifter Victron MPPT In both cases I only get either half of the values from the MPPT. Situation 1: Only Batttery voltage, Panel Current, Panel Power... Situation 2: Only error code, Yield today, Yield Yesterday, Yield Total... It seems like the readout of RS232 interface is interrupted by some other routine of the ESPs. Depending on the timing of flashing or read logs I sometimes get Situation 1 and sometimes Situation 2 on both devices. ESP32 has Situation 1 and ESP8266 has Situation 2 in the logs below.

Any help is very much appreciated - thanks a lot in advance!

ESP32:
INFO ESPHome 2024.2.2
INFO Reading configuration /config/esphome/esphome-web-fe5eac.yaml...
INFO Starting log output from 192.168.178.117 using esphome API
INFO Successfully connected to esphome-web-fe5eac @ 192.168.178.117 in 0.059s
INFO Successful handshake with esphome-web-fe5eac @ 192.168.178.117 in 0.102s
[19:14:06][I][app:102]: ESPHome version 2024.2.2 compiled on Mar 25 2024, 15:05:28
[19:14:06][C][wifi:577]: WiFi:
[19:14:06][C][wifi:409]:   Local MAC: 24:62:AB:FE:5E:AC
[19:14:06][C][wifi:414]:   SSID: 'WLAN-001'[redacted]
[19:14:06][C][wifi:415]:   IP Address: 192.168.178.117
[19:14:06][C][wifi:417]:   BSSID: 50:E6:36:4C:08:38[redacted]
[19:14:06][C][wifi:418]:   Hostname: 'esphome-web-fe5eac'
[19:14:06][C][wifi:420]:   Signal strength: -80 dB ▂▄▆█
[19:14:06][C][wifi:424]:   Channel: 1
[19:14:06][C][wifi:425]:   Subnet: 255.255.255.0
[19:14:06][C][wifi:426]:   Gateway: 192.168.178.1
[19:14:06][C][wifi:427]:   DNS1: 192.168.178.1
[19:14:06][C][wifi:428]:   DNS2: 0.0.0.0
[19:14:06][C][logger:447]: Logger:
[19:14:06][C][logger:448]:   Level: DEBUG
[19:14:06][C][logger:449]:   Log Baud Rate: 115200
[19:14:06][C][logger:451]:   Hardware UART: UART0
[19:14:06][C][uart.arduino_esp32:137]: UART Bus 1:
[19:14:06][C][uart.arduino_esp32:138]:   TX Pin: GPIO17
[19:14:06][C][uart.arduino_esp32:139]:   RX Pin: GPIO16
[19:14:06][C][uart.arduino_esp32:141]:   RX Buffer Size: 512
[19:14:06][C][uart.arduino_esp32:143]:   Baud Rate: 19200 baud
[19:14:06][C][uart.arduino_esp32:144]:   Data Bits: 8
[19:14:06][C][uart.arduino_esp32:145]:   Parity: NONE
[19:14:06][C][uart.arduino_esp32:146]:   Stop bits: 1
[19:14:06][C][victron:032]: Victron:
[19:14:06][C][victron:035]:   Max Power Yesterday 'max power yesterday'
[19:14:06][C][victron:035]:     Device Class: 'power'
[19:14:06][C][victron:035]:     State Class: ''
[19:14:06][C][victron:035]:     Unit of Measurement: 'W'
[19:14:06][C][victron:035]:     Accuracy Decimals: 0
[19:14:06][C][victron:035]:     Icon: 'mdi:power'
[19:14:06][C][victron:036]:   Max Power Today 'max power today'
[19:14:06][C][victron:036]:     Device Class: 'power'
[19:14:06][C][victron:036]:     State Class: ''
[19:14:06][C][victron:036]:     Unit of Measurement: 'W'
[19:14:06][C][victron:036]:     Accuracy Decimals: 0
[19:14:06][C][victron:036]:     Icon: 'mdi:power'
[19:14:06][C][victron:037]:   Yield Total 'yield total'
[19:14:06][C][victron:037]:     Device Class: 'energy'
[19:14:06][C][victron:037]:     State Class: 'total_increasing'
[19:14:06][C][victron:037]:     Unit of Measurement: 'Wh'
[19:14:06][C][victron:037]:     Accuracy Decimals: 0
[19:14:06][C][victron:037]:     Icon: 'mdi:power'
[19:14:06][C][victron:038]:   Yield Yesterday 'yield yesterday'
[19:14:06][C][victron:038]:     Device Class: 'energy'
[19:14:06][C][victron:038]:     State Class: 'total_increasing'
[19:14:06][C][victron:038]:     Unit of Measurement: 'Wh'
[19:14:06][C][victron:038]:     Accuracy Decimals: 0
[19:14:06][C][victron:038]:     Icon: 'mdi:power'
[19:14:06][C][victron:039]:   Yield Today 'yield today'
[19:14:06][C][victron:039]:     Device Class: 'energy'
[19:14:06][C][victron:039]:     State Class: 'total_increasing'
[19:14:06][C][victron:039]:     Unit of Measurement: 'Wh'
[19:14:06][C][victron:039]:     Accuracy Decimals: 0
[19:14:06][C][victron:039]:     Icon: 'mdi:power'
[19:14:06][C][victron:040]:   Panel Voltage 'panel voltage'
[19:14:06][C][victron:040]:     Device Class: 'voltage'
[19:14:06][C][victron:040]:     State Class: ''
[19:14:06][C][victron:040]:     Unit of Measurement: 'V'
[19:14:06][C][victron:040]:     Accuracy Decimals: 3
[19:14:06][C][victron:040]:     Icon: 'mdi:flash'
[19:14:06][C][victron:041]:   Panel Power 'panel power'
[19:14:06][C][victron:041]:     Device Class: 'power'
[19:14:06][C][victron:041]:     State Class: ''
[19:14:06][C][victron:041]:     Unit of Measurement: 'W'
[19:14:06][C][victron:041]:     Accuracy Decimals: 0
[19:14:06][C][victron:041]:     Icon: 'mdi:power'
[19:14:06][C][victron:042]:   Battery Voltage 'battery voltage'
[19:14:06][C][victron:042]:     Device Class: 'voltage'
[19:14:06][C][victron:042]:     State Class: ''
[19:14:06][C][victron:042]:     Unit of Measurement: 'V'
[19:14:06][C][victron:042]:     Accuracy Decimals: 3
[19:14:06][C][victron:042]:     Icon: 'mdi:flash'
[19:14:06][C][victron:045]:   Battery Current 'panel current'
[19:14:06][C][victron:045]:     Device Class: 'current'
[19:14:06][C][victron:045]:     State Class: ''
[19:14:06][C][victron:045]:     Unit of Measurement: 'A'
[19:14:06][C][victron:045]:     Accuracy Decimals: 3
[19:14:06][C][victron:045]:     Icon: 'mdi:current-ac'
[19:14:06][C][victron:050]:   Load Current 'load current'
[19:14:06][C][victron:050]:     Device Class: 'current'
[19:14:06][C][victron:050]:     State Class: ''
[19:14:06][C][victron:050]:     Unit of Measurement: 'A'
[19:14:06][C][victron:050]:     Accuracy Decimals: 3
[19:14:06][C][victron:050]:     Icon: 'mdi:current-ac'
[19:14:06][C][victron:051]:   Day Number 'day number'
[19:14:06][C][victron:051]:     State Class: ''
[19:14:06][C][victron:051]:     Unit of Measurement: ''
[19:14:06][C][victron:051]:     Accuracy Decimals: 0
[19:14:06][C][victron:052]:   Charging Mode ID 'charging mode id'
[19:14:06][C][victron:052]:     State Class: ''
[19:14:06][C][victron:052]:     Unit of Measurement: ''
[19:14:06][C][victron:052]:     Accuracy Decimals: 0
[19:14:06][C][victron:053]:   Error Code 'error code'
[19:14:06][C][victron:053]:     State Class: ''
[19:14:06][C][victron:053]:     Unit of Measurement: ''
[19:14:06][C][victron:053]:     Accuracy Decimals: 0
[19:14:06][C][victron:055]:   Tracking Mode ID 'tracking mode id'
[19:14:06][C][victron:055]:     State Class: ''
[19:14:06][C][victron:055]:     Unit of Measurement: ''
[19:14:06][C][victron:055]:     Accuracy Decimals: 0
[19:14:06][C][victron:058]:   Charging Mode 'charging mode'
[19:14:06][C][victron:059]:   Error Text 'error'
[19:14:06][C][victron:061]:   Tracking Mode 'tracking mode'
[19:14:06][C][victron:063]:   Firmware Version 'firmware version'
[19:14:06][C][victron:065]:   Device Type 'device type'
[19:14:06][D][sensor:094]: 'battery voltage': Sending state 52.62000 V with 3 decimals of accuracy
[19:14:06][D][sensor:094]: 'panel current': Sending state 0.00000 A with 3 decimals of accuracy
[19:14:06][D][sensor:094]: 'panel voltage': Sending state 16.10000 V with 3 decimals of accuracy
[19:14:06][D][sensor:094]: 'panel power': Sending state 0.00000 W with 0 decimals of accuracy
[19:14:06][D][sensor:094]: 'tracking mode id': Sending state 0.00000  with 0 decimals of accuracy
[19:14:06][D][text_sensor:064]: 'tracking mode': Sending state 'Off'
[19:14:06][D][sensor:094]: 'charging mode id': Sending state 0.00000  with 0 decimals of accuracy
[19:14:06][D][text_sensor:064]: 'charging mode': Sending state 'Off'
[19:14:06][W][component:214]: Component esphome.coroutine took a long time for an operation (0.08 s).
[19:14:06][W][component:215]: Components should block for at most 20-30ms.
[19:14:06][C][captive_portal:088]: Captive Portal:
[19:14:06][C][mdns:115]: mDNS:
[19:14:06][C][mdns:116]:   Hostname: esphome-web-fe5eac
[19:14:06][C][ota:096]: Over-The-Air Updates:
[19:14:06][C][ota:097]:   Address: esphome-web-fe5eac.local:3232
[19:14:06][C][ota:103]:   OTA version: 2.
[19:14:06][C][api:139]: API Server:
[19:14:06][C][api:140]:   Address: esphome-web-fe5eac.local:6053
[19:14:06][C][api:142]:   Using noise encryption: YES
[19:14:07][D][sensor:094]: 'battery voltage': Sending state 52.61000 V with 3 decimals of accuracy
[19:14:07][D][sensor:094]: 'panel current': Sending state 0.00000 A with 3 decimals of accuracy
[19:14:07][D][sensor:094]: 'panel voltage': Sending state 16.07000 V with 3 decimals of accuracy
[19:14:07][D][sensor:094]: 'panel power': Sending state 0.00000 W with 0 decimals of accuracy
[19:14:07][D][sensor:094]: 'tracking mode id': Sending state 0.00000  with 0 decimals of accuracy
[19:14:07][D][text_sensor:064]: 'tracking mode': Sending state 'Off'
[19:14:07][D][sensor:094]: 'charging mode id': Sending state 0.00000  with 0 decimals of accuracy
[19:14:07][D][text_sensor:064]: 'charging mode': Sending state 'Off'
[19:14:07][W][component:214]: Component esphome.coroutine took a long time for an operation (0.07 s).
[19:14:07][W][component:215]: Components should block for at most 20-30ms.
[19:14:08][D][sensor:094]: 'battery voltage': Sending state 52.61000 V with 3 decimals of accuracy
[19:14:08][D][sensor:094]: 'panel current': Sending state 0.00000 A with 3 decimals of accuracy
[19:14:08][D][sensor:094]: 'panel voltage': Sending state 16.03000 V with 3 decimals of accuracy
[19:14:08][D][sensor:094]: 'panel power': Sending state 0.00000 W with 0 decimals of accuracy
[19:14:08][D][sensor:094]: 'tracking mode id': Sending state 0.00000  with 0 decimals of accuracy
[19:14:08][D][text_sensor:064]: 'tracking mode': Sending state 'Off'
[19:14:08][D][sensor:094]: 'charging mode id': Sending state 0.00000  with 0 decimals of accuracy
[19:14:08][D][text_sensor:064]: 'charging mode': Sending state 'Off'
[19:14:08][W][component:214]: Component esphome.coroutine took a long time for an operation (0.09 s).
[19:14:08][W][component:215]: Components should block for at most 20-30ms.
[19:14:09][D][sensor:094]: 'battery voltage': Sending state 52.61000 V with 3 decimals of accuracy
[19:14:09][D][sensor:094]: 'panel current': Sending state 0.00000 A with 3 decimals of accuracy
[19:14:09][D][sensor:094]: 'panel voltage': Sending state 15.99000 V with 3 decimals of accuracy
[19:14:09][D][sensor:094]: 'panel power': Sending state 0.00000 W with 0 decimals of accuracy
[19:14:09][D][sensor:094]: 'tracking mode id': Sending state 0.00000  with 0 decimals of accuracy
[19:14:09][D][text_sensor:064]: 'tracking mode': Sending state 'Off'
[19:14:09][D][sensor:094]: 'charging mode id': Sending state 0.00000  with 0 decimals of accuracy
[19:14:09][D][text_sensor:064]: 'charging mode': Sending state 'Off'
[19:14:09][W][component:214]: Component esphome.coroutine took a long time for an operation (0.08 s).
[19:14:09][W][component:215]: Components should block for at most 20-30ms.

ESP8266:
INFO ESPHome 2024.2.2
INFO Reading configuration /config/esphome/esphome-web-85a18a.yaml...
INFO Starting log output from 192.168.178.43 using esphome API
INFO Successfully connected to esphome-web-85a18a @ 192.168.178.43 in 0.017s
INFO Successful handshake with esphome-web-85a18a @ 192.168.178.43 in 2.533s
[19:29:15][I][app:102]: ESPHome version 2024.2.2 compiled on Mar 23 2024, 22:03:23
[19:29:15][C][wifi:577]: WiFi:
[19:29:15][C][wifi:409]:   Local MAC: BC:FF:4D:85:A1:8A
[19:29:15][C][wifi:414]:   SSID: 'WLAN-001'[redacted]
[19:29:15][C][wifi:415]:   IP Address: 192.168.178.43
[19:29:15][C][wifi:416]:   BSSID: 50:E6:36:4C:08:38[redacted]
[19:29:15][C][wifi:418]:   Hostname: 'esphome-web-85a18a'
[19:29:15][C][wifi:420]:   Signal strength: -75 dB ▂▄▆█
[19:29:15][C][wifi:424]:   Channel: 1
[19:29:15][C][wifi:425]:   Subnet: 255.255.255.0
[19:29:15][C][wifi:426]:   Gateway: 192.168.178.1
[19:29:15][C][wifi:427]:   DNS1: 192.168.178.1
[19:29:15][C][wifi:428]:   DNS2: 0.0.0.0
[19:29:15][C][logger:447]: Logger:
[19:29:15][C][logger:448]:   Level: DEBUG
[19:29:15][C][logger:449]:   Log Baud Rate: 115200
[19:29:15][C][logger:451]:   Hardware UART: UART0
[19:29:15][C][uart.arduino_esp8266:118]: UART Bus:
[19:29:15][C][uart.arduino_esp8266:119]:   TX Pin: GPIO15
[19:29:15][C][uart.arduino_esp8266:120]:   RX Pin: GPIO13
[19:29:15][C][uart.arduino_esp8266:122]:   RX Buffer Size: 128
[19:29:15][C][uart.arduino_esp8266:124]:   Baud Rate: 19200 baud
[19:29:15][C][uart.arduino_esp8266:125]:   Data Bits: 8
[19:29:15][C][uart.arduino_esp8266:126]:   Parity: NONE
[19:29:15][C][uart.arduino_esp8266:127]:   Stop bits: 1
[19:29:15][C][uart.arduino_esp8266:131]:   Using software serial
[19:29:15][C][victron:032]: Victron:
[19:29:15][C][victron:035]:   Max Power Yesterday 'max power yesterday'
[19:29:15][C][victron:035]:     Device Class: 'power'
[19:29:15][C][victron:035]:     State Class: ''
[19:29:15][C][victron:035]:     Unit of Measurement: 'W'
[19:29:15][C][victron:035]:     Accuracy Decimals: 0
[19:29:15][C][victron:035]:     Icon: 'mdi:power'
[19:29:15][C][victron:036]:   Max Power Today 'max power today'
[19:29:15][C][victron:036]:     Device Class: 'power'
[19:29:15][C][victron:036]:     State Class: ''
[19:29:15][C][victron:036]:     Unit of Measurement: 'W'
[19:29:15][C][victron:036]:     Accuracy Decimals: 0
[19:29:15][C][victron:036]:     Icon: 'mdi:power'
[19:29:15][C][victron:037]:   Yield Total 'yield total'
[19:29:15][C][victron:037]:     Device Class: 'energy'
[19:29:15][C][victron:037]:     State Class: 'total_increasing'
[19:29:15][C][victron:037]:     Unit of Measurement: 'Wh'
[19:29:15][C][victron:037]:     Accuracy Decimals: 0
[19:29:15][C][victron:037]:     Icon: 'mdi:power'
[19:29:15][C][victron:038]:   Yield Yesterday 'yield yesterday'
[19:29:15][C][victron:038]:     Device Class: 'energy'
[19:29:15][C][victron:038]:     State Class: 'total_increasing'
[19:29:15][C][victron:038]:     Unit of Measurement: 'Wh'
[19:29:15][C][victron:038]:     Accuracy Decimals: 0
[19:29:15][C][victron:038]:     Icon: 'mdi:power'
[19:29:15][C][victron:039]:   Yield Today 'yield today'
[19:29:15][C][victron:039]:     Device Class: 'energy'
[19:29:15][C][victron:039]:     State Class: 'total_increasing'
[19:29:15][C][victron:039]:     Unit of Measurement: 'Wh'
[19:29:15][C][victron:039]:     Accuracy Decimals: 0
[19:29:15][C][victron:039]:     Icon: 'mdi:power'
[19:29:15][C][victron:040]:   Panel Voltage 'panel voltage'
[19:29:15][C][victron:040]:     Device Class: 'voltage'
[19:29:15][C][victron:040]:     State Class: ''
[19:29:15][C][victron:040]:     Unit of Measurement: 'V'
[19:29:15][C][victron:040]:     Accuracy Decimals: 3
[19:29:15][C][victron:040]:     Icon: 'mdi:flash'
[19:29:15][C][victron:041]:   Panel Power 'panel power'
[19:29:15][C][victron:041]:     Device Class: 'power'
[19:29:15][C][victron:041]:     State Class: ''
[19:29:15][C][victron:041]:     Unit of Measurement: 'W'
[19:29:15][C][victron:041]:     Accuracy Decimals: 0
[19:29:15][C][victron:041]:     Icon: 'mdi:power'
[19:29:15][C][victron:042]:   Battery Voltage 'battery voltage'
[19:29:15][C][victron:042]:     Device Class: 'voltage'
[19:29:15][C][victron:042]:     State Class: ''
[19:29:15][C][victron:042]:     Unit of Measurement: 'V'
[19:29:15][C][victron:042]:     Accuracy Decimals: 3
[19:29:15][C][victron:042]:     Icon: 'mdi:flash'
[19:29:15][C][victron:045]:   Battery Current 'panel current'
[19:29:15][C][victron:045]:     Device Class: 'current'
[19:29:15][C][victron:045]:     State Class: ''
[19:29:15][C][victron:045]:     Unit of Measurement: 'A'
[19:29:15][C][victron:045]:     Accuracy Decimals: 3
[19:29:15][C][victron:045]:     Icon: 'mdi:current-ac'
[19:29:15][C][victron:050]:   Load Current 'load current'
[19:29:15][C][victron:050]:     Device Class: 'current'
[19:29:15][C][victron:050]:     State Class: ''
[19:29:15][C][victron:050]:     Unit of Measurement: 'A'
[19:29:15][C][victron:050]:     Accuracy Decimals: 3
[19:29:15][C][victron:050]:     Icon: 'mdi:current-ac'
[19:29:15][C][victron:051]:   Day Number 'day number'
[19:29:15][C][victron:051]:     State Class: ''
[19:29:15][C][victron:051]:     Unit of Measurement: ''
[19:29:15][C][victron:051]:     Accuracy Decimals: 0
[19:29:15][C][victron:052]:   Charging Mode ID 'charging mode id'
[19:29:15][C][victron:052]:     State Class: ''
[19:29:15][C][victron:052]:     Unit of Measurement: ''
[19:29:15][C][victron:052]:     Accuracy Decimals: 0
[19:29:15][C][victron:053]:   Error Code 'error code'
[19:29:15][C][victron:053]:     State Class: ''
[19:29:15][C][victron:053]:     Unit of Measurement: ''
[19:29:15][C][victron:053]:     Accuracy Decimals: 0
[19:29:15][C][victron:055]:   Tracking Mode ID 'tracking mode id'
[19:29:15][C][victron:055]:     State Class: ''
[19:29:15][C][victron:055]:     Unit of Measurement: ''
[19:29:15][C][victron:055]:     Accuracy Decimals: 0
[19:29:15][C][victron:058]:   Charging Mode 'charging mode'
[19:29:15][C][victron:059]:   Error Text 'error'
[19:29:15][C][victron:061]:   Tracking Mode 'tracking mode'
[19:29:15][C][victron:063]:   Firmware Version 'firmware version'
[19:29:15][C][victron:065]:   Device Type 'device type'
[19:29:15][D][sensor:093]: 'error code': Sending state 0.00000  with 0 decimals of accuracy
[19:29:15][D][text_sensor:064]: 'error': Sending state 'No error'
[19:29:15][D][sensor:093]: 'yield total': Sending state 21040.00000 Wh with 0 decimals of accuracy
[19:29:15][D][sensor:093]: 'yield today': Sending state 11360.00000 Wh with 0 decimals of accuracy
[19:29:15][D][sensor:093]: 'max power today': Sending state 3438.00000 W with 0 decimals of accuracy
[19:29:15][D][sensor:093]: 'yield yesterday': Sending state 9680.00000 Wh with 0 decimals of accuracy
[19:29:15][D][sensor:093]: 'max power yesterday': Sending state 3270.00000 W with 0 decimals of accuracy
[19:29:15][D][sensor:093]: 'day number': Sending state 1.00000  with 0 decimals of accuracy
[19:29:15][W][component:214]: Component esphome.coroutine took a long time for an operation (0.07 s).
[19:29:16][W][component:215]: Components should block for at most 20-30ms.
[19:29:16][C][captive_portal:088]: Captive Portal:
[19:29:16][C][mdns:115]: mDNS:
[19:29:16][C][mdns:116]:   Hostname: esphome-web-85a18a
[19:29:16][C][ota:096]: Over-The-Air Updates:
[19:29:16][C][ota:097]:   Address: esphome-web-85a18a.local:8266
[19:29:16][C][ota:103]:   OTA version: 2.
[19:29:16][C][api:139]: API Server:
[19:29:16][C][api:140]:   Address: esphome-web-85a18a.local:6053
[19:29:16][C][api:142]:   Using noise encryption: YES
[19:29:16][D][sensor:093]: 'error code': Sending state 0.00000  with 0 decimals of accuracy
[19:29:16][D][text_sensor:064]: 'error': Sending state 'No error'
[19:29:16][D][sensor:093]: 'yield total': Sending state 21040.00000 Wh with 0 decimals of accuracy
[19:29:16][D][sensor:093]: 'yield today': Sending state 11360.00000 Wh with 0 decimals of accuracy
[19:29:16][D][sensor:093]: 'max power today': Sending state 3438.00000 W with 0 decimals of accuracy
[19:29:16][D][sensor:093]: 'yield yesterday': Sending state 9680.00000 Wh with 0 decimals of accuracy
[19:29:16][D][sensor:093]: 'max power yesterday': Sending state 3270.00000 W with 0 decimals of accuracy
[19:29:16][D][sensor:093]: 'day number': Sending state 1.00000  with 0 decimals of accuracy
[19:29:16][W][component:214]: Component esphome.coroutine took a long time for an operation (0.09 s).
[19:29:16][W][component:215]: Components should block for at most 20-30ms.
[19:29:18][D][sensor:093]: 'error code': Sending state 0.00000  with 0 decimals of accuracy
[19:29:18][D][text_sensor:064]: 'error': Sending state 'No error'
[19:29:18][D][sensor:093]: 'yield total': Sending state 21040.00000 Wh with 0 decimals of accuracy
[19:29:18][D][sensor:093]: 'yield today': Sending state 11360.00000 Wh with 0 decimals of accuracy
[19:29:18][D][sensor:093]: 'max power today': Sending state 3438.00000 W with 0 decimals of accuracy
[19:29:18][D][sensor:093]: 'yield yesterday': Sending state 9680.00000 Wh with 0 decimals of accuracy
[19:29:18][D][sensor:093]: 'max power yesterday': Sending state 3270.00000 W with 0 decimals of accuracy
[19:29:18][D][sensor:093]: 'day number': Sending state 1.00000  with 0 decimals of accuracy
[19:29:18][W][component:214]: Component esphome.coroutine took a long time for an operation (0.10 s).
[19:29:18][W][component:215]: Components should block for at most 20-30ms.
[19:29:19][D][sensor:093]: 'error code': Sending state 0.00000  with 0 decimals of accuracy
[19:29:19][D][text_sensor:064]: 'error': Sending state 'No error'
[19:29:19][D][sensor:093]: 'yield total': Sending state 21040.00000 Wh with 0 decimals of accuracy
[19:29:19][D][sensor:093]: 'yield today': Sending state 11360.00000 Wh with 0 decimals of accuracy
[19:29:19][D][sensor:093]: 'max power today': Sending state 3438.00000 W with 0 decimals of accuracy
[19:29:19][D][sensor:093]: 'yield yesterday': Sending state 9680.00000 Wh with 0 decimals of accuracy
[19:29:19][D][sensor:093]: 'max power yesterday': Sending state 3270.00000 W with 0 decimals of accuracy
[19:29:19][D][sensor:093]: 'day number': Sending state 1.00000  with 0 decimals of accuracy
[19:29:19][W][component:214]: Component esphome.coroutine took a long time for an operation (0.10 s).
[19:29:19][W][component:215]: Components should block for at most 20-30ms.
[19:29:20][D][sensor:093]: 'error code': Sending state 0.00000  with 0 decimals of accuracy
[19:29:20][D][text_sensor:064]: 'error': Sending state 'No error'
[19:29:20][D][sensor:093]: 'yield total': Sending state 21040.00000 Wh with 0 decimals of accuracy
[19:29:20][D][sensor:093]: 'yield today': Sending state 11360.00000 Wh with 0 decimals of accuracy
[19:29:20][D][sensor:093]: 'max power today': Sending state 3438.00000 W with 0 decimals of accuracy
[19:29:20][D][sensor:093]: 'yield yesterday': Sending state 9680.00000 Wh with 0 decimals of accuracy
[19:29:20][D][sensor:093]: 'max power yesterday': Sending state 3270.00000 W with 0 decimals of accuracy
[19:29:20][D][sensor:093]: 'day number': Sending state 1.00000  with 0 decimals of accuracy
[19:29:20][W][component:214]: Component esphome.coroutine took a long time for an operation (0.09 s).
[19:29:20][W][component:215]: Components should block for at most 20-30ms.

Code ESP32:

esphome:
  name: esphome-web-fe5eac
  friendly_name: Victron_MPPT_ESP32

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  #baud_rate: 19200
  #level: WARN
  #logs:
    #component: ERROR

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxx"

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  #ap:
    #ssid: "Esphome-Web-Fe5Eac"
    #password: "xxx"

captive_portal:

external_components:
  #- source: github://B00GI3M4N/VictronMPPT-ESPHOME_FIX@main
  - source: github://KinDR007/VictronMPPT-ESPHOME@main

uart:
  id: uart_0
  tx_pin: GPIO17  # Not used! The communication is read-only
  rx_pin: GPIO16
  baud_rate: 19200
  rx_buffer_size: 512 #86

victron:
  id: victron0
  uart_id: uart_0  

sensor:
  - platform: victron
    victron_id: victron0
    max_power_yesterday:
      name: "max power yesterday"
    panel_voltage:
      name: "panel voltage"
      #filters:
      #- throttle: 1s
    panel_power:
      name: "panel power"
     # filters:
     # - throttle: 1s
    battery_current:
      name: "panel current"
     # filters:
      #- throttle: 1s
    battery_voltage:
      name: "battery voltage"
      #filters:
      #- throttle: 1s
    max_power_today:
      name: "max power today"
     # filters:
      #- throttle: 1s
    yield_total:
      name: "yield total"
     # filters:
      #- throttle: 1s
    yield_yesterday:
      name: "yield yesterday"
     # filters:
      #- throttle: 1s
    yield_today:
      name: "yield today"
     # filters:
      #- throttle: 1s
    day_number:
      name: "day number"
    charging_mode_id:
      name: "charging mode id"
    error_code:
      name: "error code"
    tracking_mode_id:
      name: "tracking mode id"
    load_current:
      name: "load current"

text_sensor:
  - platform: victron
    victron_id: victron0
    charging_mode:
      name: "charging mode"
    error:
      name: "error"
    tracking_mode:
      name: "tracking mode"
    firmware_version:
      name: "firmware version"
    device_type:
      name: "device type"
    serial_number:
      name: "serial number"

#binary_sensor:
# - platform: victron
#    victron_id: victron0
#    load_state:
#      name: "load state"
#    relay_state:
#      name: "relay state"

Code ESP8266:
esphome:
  name: esphome-web-85a18a
  friendly_name: Victron_MPPT_2

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxx"

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-85A18A"
    password: "xxx"

captive_portal:

external_components:
  #- source: github://B00GI3M4N/VictronMPPT-ESPHOME_FIX@main
  - source: github://KinDR007/VictronMPPT-ESPHOME@main

uart:
  id: uart_0
  tx_pin: D8  # Not used! The communication is read-only
  rx_pin: D7
  baud_rate: 19200
  rx_buffer_size: 128 #86

victron:
  id: victron0
  uart_id: uart_0  

sensor:
  - platform: victron
    victron_id: victron0
    max_power_yesterday:
      name: "max power yesterday"
    panel_voltage:
      name: "panel voltage"
      #filters:
      #- throttle: 1s
    panel_power:
      name: "panel power"
     # filters:
     # - throttle: 1s
    battery_current:
      name: "panel current"
     # filters:
      #- throttle: 1s
    battery_voltage:
      name: "battery voltage"
      #filters:
      #- throttle: 1s
    max_power_today:
      name: "max power today"
     # filters:
      #- throttle: 1s
    yield_total:
      name: "yield total"
     # filters:
      #- throttle: 1s
    yield_yesterday:
      name: "yield yesterday"
     # filters:
      #- throttle: 1s
    yield_today:
      name: "yield today"
     # filters:
      #- throttle: 1s
    day_number:
      name: "day number"
    charging_mode_id:
      name: "charging mode id"
    error_code:
      name: "error code"
    tracking_mode_id:
      name: "tracking mode id"
    load_current:
      name: "load current"

text_sensor:
  - platform: victron
    victron_id: victron0
    charging_mode:
      name: "charging mode"
    error:
      name: "error"
    tracking_mode:
      name: "tracking mode"
    firmware_version:
      name: "firmware version"
    device_type:
      name: "device type"
    serial_number:
      name: "serial number"

#binary_sensor:
# - platform: victron
#    victron_id: victron0
#    load_state:
#      name: "load state"
#    relay_state:
#      name: "relay state"   
donaldstod commented 3 months ago

Ok, sorry going through all other issues I realized this:

victron: id: victron0 throttle: 10s# <-- This uart_id: uart_0

solves the problem at least the messages change from Situation 1 to Situation 2 every 10s. Still a little unsatisfying because with this delay it is a lot less fun to watch it run :-(

syssi commented 3 months ago

Please try the ESP-IDF framework instead of the Arduino one (if you are using a ESP32).

donaldstod commented 3 months ago

Hi syssi,

thank you that erased the warning and I was able to reduce the throttle down to 6s. Is there any possibility to split the publishing into two parts to further decrease the throttle? My wish would be 1-2s throttle to see the MPPT work

INFO ESPHome 2024.2.2 INFO Reading configuration /config/esphome/esphome-web-fe5eac.yaml... INFO Starting log output from 192.168.178.117 using esphome API INFO Successfully connected to esphome-web-fe5eac @ 192.168.178.117 in 0.012s INFO Successful handshake with esphome-web-fe5eac @ 192.168.178.117 in 0.110s [22:30:42][I][app:102]: ESPHome version 2024.2.2 compiled on Mar 25 2024, 22:27:52

[22:30:42][C][wifi:409]: Local MAC: 24:62:AB:FE:5E:AC [22:30:42][C][wifi:414]: SSID: 'WLAN-001'[redacted] [22:30:42][C][wifi:415]: IP Address: 192.168.178.117 [22:30:42][C][wifi:417]: BSSID: 50:E6:36:4C:08:38[redacted]

[22:30:42][C][wifi:420]: Signal strength: -79 dB ▂▄▆█ [22:30:42][C][wifi:424]: Channel: 1 [22:30:42][C][wifi:425]: Subnet: 255.255.255.0 [22:30:42][C][wifi:426]: Gateway: 192.168.178.1 [22:30:42][C][wifi:427]: DNS1: 192.168.178.1 [22:30:42][C][wifi:428]: DNS2: 0.0.0.0

[22:30:42][C][logger:448]: Level: DEBUG [22:30:42][C][logger:449]: Log Baud Rate: 115200 [22:30:42][C][logger:451]: Hardware UART: UART0 [22:30:42][C][uart.idf:139]: UART Bus 1: [22:30:42][C][uart.idf:140]: TX Pin: GPIO17 [22:30:42][C][uart.idf:141]: RX Pin: GPIO16 [22:30:42][C][uart.idf:143]: RX Buffer Size: 256 [22:30:42][C][uart.idf:145]: Baud Rate: 19200 baud [22:30:42][C][uart.idf:146]: Data Bits: 8 [22:30:42][C][uart.idf:147]: Parity: NONE [22:30:42][C][uart.idf:148]: Stop bits: 1

[22:30:42][C][victron:035]: Max Power Yesterday 'max power yesterday' [22:30:42][C][victron:035]: Device Class: 'power' [22:30:42][C][victron:035]: State Class: '' [22:30:42][C][victron:035]: Unit of Measurement: 'W' [22:30:42][C][victron:035]: Accuracy Decimals: 0

[22:30:42][C][victron:036]: Max Power Today 'max power today' [22:30:42][C][victron:036]: Device Class: 'power' [22:30:42][C][victron:036]: State Class: '' [22:30:42][C][victron:036]: Unit of Measurement: 'W' [22:30:42][C][victron:036]: Accuracy Decimals: 0

[22:30:42][C][victron:037]: Yield Total 'yield total' [22:30:42][C][victron:037]: Device Class: 'energy' [22:30:42][C][victron:037]: State Class: 'total_increasing' [22:30:42][C][victron:037]: Unit of Measurement: 'Wh' [22:30:42][C][victron:037]: Accuracy Decimals: 0

[22:30:42][C][victron:038]: Yield Yesterday 'yield yesterday' [22:30:42][C][victron:038]: Device Class: 'energy' [22:30:42][C][victron:038]: State Class: 'total_increasing' [22:30:42][C][victron:038]: Unit of Measurement: 'Wh' [22:30:42][C][victron:038]: Accuracy Decimals: 0

[22:30:42][C][victron:039]: Yield Today 'yield today' [22:30:42][C][victron:039]: Device Class: 'energy' [22:30:42][C][victron:039]: State Class: 'total_increasing' [22:30:42][C][victron:039]: Unit of Measurement: 'Wh' [22:30:42][C][victron:039]: Accuracy Decimals: 0

[22:30:42][C][victron:040]: Panel Voltage 'panel voltage' [22:30:42][C][victron:040]: Device Class: 'voltage' [22:30:42][C][victron:040]: State Class: '' [22:30:42][C][victron:040]: Unit of Measurement: 'V' [22:30:42][C][victron:040]: Accuracy Decimals: 3

[22:30:42][C][victron:041]: Panel Power 'panel power' [22:30:42][C][victron:041]: Device Class: 'power' [22:30:42][C][victron:041]: State Class: '' [22:30:42][C][victron:041]: Unit of Measurement: 'W' [22:30:42][C][victron:041]: Accuracy Decimals: 0

[22:30:42][C][victron:042]: Battery Voltage 'battery voltage' [22:30:42][C][victron:042]: Device Class: 'voltage' [22:30:42][C][victron:042]: State Class: '' [22:30:42][C][victron:042]: Unit of Measurement: 'V' [22:30:42][C][victron:042]: Accuracy Decimals: 3

[22:30:42][C][victron:045]: Battery Current 'panel current' [22:30:42][C][victron:045]: Device Class: 'current' [22:30:42][C][victron:045]: State Class: '' [22:30:42][C][victron:045]: Unit of Measurement: 'A' [22:30:42][C][victron:045]: Accuracy Decimals: 3

[22:30:42][C][victron:050]: Load Current 'load current' [22:30:42][C][victron:050]: Device Class: 'current' [22:30:42][C][victron:050]: State Class: '' [22:30:42][C][victron:050]: Unit of Measurement: 'A' [22:30:42][C][victron:050]: Accuracy Decimals: 3

[22:30:42][C][victron:051]: Day Number 'day number' [22:30:42][C][victron:051]: State Class: '' [22:30:42][C][victron:051]: Unit of Measurement: '' [22:30:42][C][victron:051]: Accuracy Decimals: 0 [22:30:42][C][victron:052]: Charging Mode ID 'charging mode id' [22:30:42][C][victron:052]: State Class: '' [22:30:42][C][victron:052]: Unit of Measurement: '' [22:30:42][C][victron:052]: Accuracy Decimals: 0 [22:30:42][C][victron:053]: Error Code 'error code' [22:30:42][C][victron:053]: State Class: '' [22:30:42][C][victron:053]: Unit of Measurement: '' [22:30:42][C][victron:053]: Accuracy Decimals: 0 [22:30:42][C][victron:055]: Tracking Mode ID 'tracking mode id' [22:30:42][C][victron:055]: State Class: '' [22:30:42][C][victron:055]: Unit of Measurement: '' [22:30:42][C][victron:055]: Accuracy Decimals: 0 [22:30:42][C][victron:058]: Charging Mode 'charging mode' [22:30:42][C][victron:059]: Error Text 'error' [22:30:42][C][victron:061]: Tracking Mode 'tracking mode' [22:30:42][C][victron:063]: Firmware Version 'firmware version' [22:30:42][C][victron:065]: Device Type 'device type' [22:30:42][C][captive_portal:088]: Captive Portal:

[22:30:42][C][mdns:116]: Hostname: esphome-web-fe5eac [22:30:42][C][ota:096]: Over-The-Air Updates: [22:30:42][C][ota:097]: Address: esphome-web-fe5eac.local:3232 [22:30:42][C][ota:103]: OTA version: 2. [22:30:42][C][api:139]: API Server: [22:30:42][C][api:140]: Address: esphome-web-fe5eac.local:6053 [22:30:42][C][api:142]: Using noise encryption: YES [22:30:48][D][sensor:094]: 'battery voltage': Sending state 52.76000 V with 3 decimals of accuracy [22:30:48][D][sensor:094]: 'panel current': Sending state 0.00000 A with 3 decimals of accuracy [22:30:48][D][sensor:094]: 'panel voltage': Sending state 3.83000 V with 3 decimals of accuracy [22:30:48][D][sensor:094]: 'panel power': Sending state 0.00000 W with 0 decimals of accuracy [22:30:48][D][sensor:094]: 'tracking mode id': Sending state 0.00000 with 0 decimals of accuracy [22:30:48][D][text_sensor:064]: 'tracking mode': Sending state 'Off' [22:30:48][D][sensor:094]: 'charging mode id': Sending state 0.00000 with 0 decimals of accuracy [22:30:48][D][text_sensor:064]: 'charging mode': Sending state 'Off' [22:30:54][D][sensor:094]: 'error code': Sending state 0.00000 with 0 decimals of accuracy [22:30:54][D][text_sensor:064]: 'error': Sending state 'No error' [22:30:54][D][sensor:094]: 'yield total': Sending state 664850.00000 Wh with 0 decimals of accuracy [22:30:54][D][sensor:094]: 'yield today': Sending state 10030.00000 Wh with 0 decimals of accuracy [22:30:54][D][sensor:094]: 'max power today': Sending state 3428.00000 W with 0 decimals of accuracy [22:30:54][D][sensor:094]: 'yield yesterday': Sending state 8330.00000 Wh with 0 decimals of accuracy [22:30:54][D][sensor:094]: 'max power yesterday': Sending state 3244.00000 W with 0 decimals of accuracy [22:30:54][D][sensor:094]: 'day number': Sending state 207.00000 with 0 decimals of accuracy [22:31:00][D][sensor:094]: 'battery voltage': Sending state 52.76000 V with 3 decimals of accuracy [22:31:00][D][sensor:094]: 'panel current': Sending state 0.00000 A with 3 decimals of accuracy [22:31:00][D][sensor:094]: 'panel voltage': Sending state 3.83000 V with 3 decimals of accuracy [22:31:00][D][sensor:094]: 'panel power': Sending state 0.00000 W with 0 decimals of accuracy [22:31:00][D][sensor:094]: 'tracking mode id': Sending state 0.00000 with 0 decimals of accuracy [22:31:00][D][text_sensor:064]: 'tracking mode': Sending state 'Off' [22:31:00][D][sensor:094]: 'charging mode id': Sending state 0.00000 with 0 decimals of accuracy [22:31:00][D][text_sensor:064]: 'charging mode': Sending state 'Off'

syssi commented 3 months ago

I assume printing the log messages is time consuming. Try to set the log level to INFO. This should free many CPU cycles.

donaldstod commented 3 months ago

Hi syssi, good idea, unfortunately did not help to decrease the throttle time. Situation with the messages is the same, as soon as I go below 6s of throttle I lose values. After programing several times over-the-air, one programming was interrupted and I lost connection to the ESP32, now need to setup everything again. If it is ok for you I keep you updated about the status. Best regards, Michael

donaldstod commented 3 months ago

All the wiring and timing "problems" let me to switch to this -->[https://github.com/Fabian-Schmidt/esphome-victron_ble] solution. The throttle time is still slower than I would like it, but I don´t have to worry about all the wiring and voltage levels. If you have a SmartSolar with bluetooth and access to a ESP32, the solution above is very nice. @syssi: I saw you also contributed to bluetooth solution - thanks for your great work!