syssi / esphome-evse-wallbox

ESPHome component to monitor and control a EVSE wallbox
Apache License 2.0
10 stars 1 forks source link

Modbus readout of SimpleEVSE state fails #12

Closed torfbolt closed 1 year ago

torfbolt commented 1 year ago

I've tried this component to control a SimpleEVSE wallbox. The basics seem to work well, I can control the charging current and e.g. enable & disable the EVSE via the switches for register 2005.

But it fails to readout the rest of the state, like firmware version etc. Probably something minor with the modbus config, maybe there are some differences between the "EVSE" and "SimpleEVSE" wallboxes.

In the log I get these messages (note that it also complains when setting the charging current):

[13:47:51][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4
[13:47:53][D][number:054]: 'PV current' - Setting number value
[13:47:53][D][number:113]:   New number value: 10.000000
[13:47:53][D][number:012]: 'PV current': Sending state 10.000000
[13:47:53][D][number:054]: 'evse output current setting' - Setting number value
[13:47:53][D][number:113]:   New number value: 10.000000
[13:47:53][D][uart_debug:114]: >>> 01:10:03:E8:00:01:02:00:0A:02:7F
[13:47:53][W][evse_wallbox:058]: Invalid size (4) for EVSE wallbox frame!
[13:47:53][W][evse_wallbox:059]: Payload: 03.E8.00.01
[13:47:53][D][uart_debug:114]: <<< 01:10:03:E8:00:01:81:B9
[13:47:56][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD
[13:47:56][D][modbus:119]: Modbus error function code: 0x83 exception: 2
[13:47:56][D][modbus:124]: Ignoring Modbus error - not expecting a response

When I connect to the wallbox with the example config provided in https://github.com/stegm/esphome-simpleevse-config I can e.g. read out the correct value "10" of the "firmware version" register. But that approach fails when trying to write values to the device.

torfbolt commented 1 year ago

Btw, I found a register description of the SimpleEVSE here: https://s9f797ea9ad7dc140.jimcontent.com/download/version/1496852739/module/14154238624/name/Manual%20Bluetooth%20Modul%20f%C3%BCr%20EVSE%20WB%20V1.4.pdf

On a first glance this seems to be identical to the one used by this component.

syssi commented 1 year ago

Could you provide some more logs? Some more raw traffic will help me to debug the issue.

torfbolt commented 1 year ago

The device config:

Details substitutions: devicename: "EVSE" name: evse config_name: evse esphome: name: evse friendly_name: "EVSE Wallbox" esp32: board: lolin32 framework: type: arduino external_components: - source: github://syssi/esphome-evse-wallbox@main refresh: 0s logger: baud_rate: 0 api: ota: wifi: [redacted] captive_portal: status_led: pin: number: GPIO22 inverted: True uart: id: uart_modbus baud_rate: 9600 rx_pin: GPIO16 tx_pin: GPIO17 debug: direction: BOTH modbus: id: modbus0 uart_id: uart_modbus send_wait_time: 0ms evse_wallbox: id: evse0 modbus_id: modbus0 update_interval: 5s button: - platform: evse_wallbox turn_off_charging: name: "${name} turn off charging" binary_sensor: - platform: gpio pin: number: GPIO15 mode: INPUT_PULLUP inverted: true name: "Ladetaster" filters: - delayed_on_off: 100ms on_press: then: - switch.turn_on: manual_charging number: - platform: evse_wallbox output_current_setting: name: "${name} output current setting" id: output_current_setting output_current_default: name: "${name} output current default" min_charging_current: name: "${name} minimum charging current" - platform: template name: "PV current" id: pv_current min_value: 0 max_value: 32 step: 1 optimistic: true on_value: then: - if: condition: - switch.is_off: manual_charging then: - number.set: id: output_current_setting value: !lambda "return x;" sensor: - platform: evse_wallbox output_current_setting: name: "${name} output current setting" output_current: name: "${name} output current" vehicle_status_code: name: "${name} vehicle status code" firmware_version: name: "${name} firmware version" operation_mode_code: name: "${name} operation mode code" - platform: pulse_meter pin: number: GPIO13 mode: INPUT_PULLUP name: "Power Meter" id: power_meter internal_filter: 10ms timeout: 20s unit_of_measurement: "kW" accuracy_decimals: 3 filters: - multiply: 0.06 # (60s/1000 pulses per kWh) total: name: "Energy Meter" id: energy_meter unit_of_measurement: "kWh" accuracy_decimals: 2 filters: - multiply: 0.001 # (1000 pulses per kWh) switch: - platform: evse_wallbox disable_evse_after_charge: name: "${config_name} disable evse after charge" disable_evse: name: "${config_name} disable evse" - platform: template name: "Manual Charging" id: manual_charging optimistic: True turn_on_action: - number.set: id: output_current_setting value: 32 text_sensor: - platform: evse_wallbox vehicle_status: name: "${name} vehicle status"

Some more logs:

Details INFO Reading configuration /config/esphome/evse.yaml... INFO Updating https://github.com/syssi/esphome-evse-wallbox.git@main WARNING GPIO15 is a Strapping PIN and should be avoided. Attaching external pullup/down resistors to strapping pins can cause unexpected failures. See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins INFO Starting log output from evse.local using esphome API INFO Successfully connected to evse.local [15:10:03][I][app:102]: ESPHome version 2023.3.2 compiled on Apr 11 2023, 13:45:36 [15:10:03][C][status_led:019]: Status LED: [15:10:03][C][status_led:020]: Pin: GPIO22 [15:10:03][C][wifi:504]: WiFi: [15:10:03][C][wifi:362]: Local MAC: 30:AE:A4:C1:8A:84 [15:10:04][C][wifi:363]: SSID: [redacted] [15:10:04][C][wifi:364]: IP Address: 10.0.0.27 [15:10:04][C][wifi:366]: BSSID: [redacted] [15:10:04][C][wifi:367]: Hostname: 'evse' [15:10:04][C][wifi:369]: Signal strength: -69 dB ▂▄▆█ [15:10:04][C][wifi:373]: Channel: 5 [15:10:04][C][wifi:374]: Subnet: 255.255.255.0 [15:10:04][C][wifi:375]: Gateway: 10.0.0.1 [15:10:04][C][wifi:376]: DNS1: 10.0.0.1 [15:10:04][C][wifi:377]: DNS2: 0.0.0.0 [15:10:04][C][logger:293]: Logger: [15:10:04][C][logger:294]: Level: DEBUG [15:10:04][C][logger:295]: Log Baud Rate: 115200 [15:10:04][C][logger:296]: Hardware UART: UART0 [15:10:04][C][uart.arduino_esp32:108]: UART Bus 1: [15:10:04][C][uart.arduino_esp32:109]: TX Pin: GPIO17 [15:10:04][C][uart.arduino_esp32:110]: RX Pin: GPIO16 [15:10:04][C][uart.arduino_esp32:112]: RX Buffer Size: 256 [15:10:04][C][uart.arduino_esp32:114]: Baud Rate: 9600 baud [15:10:04][C][uart.arduino_esp32:115]: Data Bits: 8 [15:10:04][C][uart.arduino_esp32:116]: Parity: NONE [15:10:04][C][uart.arduino_esp32:117]: Stop bits: 1 [15:10:04][C][modbus:143]: Modbus: [15:10:04][C][modbus:145]: Send Wait Time: 0 ms [15:10:04][C][modbus:146]: CRC Disabled: NO [15:10:04][C][template.number:050]: Template Number 'PV current' [15:10:04][C][template.number:051]: Optimistic: YES [15:10:04][C][template.number:052]: Update Interval: 60.0s [15:10:04][C][template.switch:076]: Template Switch 'Manual Charging' [15:10:04][C][template.switch:099]: Restore Mode: restore defaults to OFF [15:10:04][C][template.switch:060]: Restore State: NO [15:10:04][C][template.switch:061]: Optimistic: YES [15:10:04][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Ladetaster' [15:10:04][C][gpio.binary_sensor:016]: Pin: GPIO15 [15:10:04][C][evse_wallbox:279]: EvseWallbox: [15:10:04][C][evse_wallbox:280]: Address: 0x01 [15:10:04][C][evse_wallbox.button:010]: EvseWallbox Button 'evse turn off charging' [15:10:04][C][evse_wallbox.number:009]: EvseWallbox Number 'evse output current setting' [15:10:04][C][evse_wallbox.number:009]: Icon: 'mdi:battery-charging-90' [15:10:04][C][evse_wallbox.number:009]: Unit of Measurement: 'A' [15:10:04][C][evse_wallbox.number:009]: EvseWallbox Number 'evse output current default' [15:10:04][C][evse_wallbox.number:009]: Icon: 'mdi:restart' [15:10:04][C][evse_wallbox.number:009]: Unit of Measurement: 'A' [15:10:04][C][evse_wallbox.number:009]: EvseWallbox Number 'evse minimum charging current' [15:10:04][C][evse_wallbox.number:009]: Icon: 'mdi:battery-heart-variant' [15:10:04][C][evse_wallbox.number:009]: Unit of Measurement: 'A' [15:10:04][C][pulse_meter:074]: Pulse Meter 'Power Meter' [15:10:04][C][pulse_meter:074]: State Class: 'measurement' [15:10:04][C][pulse_meter:074]: Unit of Measurement: 'kW' [15:10:04][C][pulse_meter:074]: Accuracy Decimals: 3 [15:10:04][C][pulse_meter:074]: Icon: 'mdi:pulse' [15:10:04][C][pulse_meter:075]: Pin: GPIO13 [15:10:04][C][pulse_meter:077]: Filtering rising edges less than 10000 µs apart [15:10:04][C][pulse_meter:081]: Assuming 0 pulses/min after not receiving a pulse for 20s [15:10:04][C][evse_wallbox.switch:076]: EvseWallbox Switch 'evse disable evse after charge' [15:10:04][C][evse_wallbox.switch:099]: Restore Mode: restore defaults to OFF [15:10:04][C][evse_wallbox.switch:076]: EvseWallbox Switch 'evse disable evse' [15:10:04][C][evse_wallbox.switch:099]: Restore Mode: restore defaults to OFF [15:10:04][C][captive_portal:088]: Captive Portal: [15:10:04][C][mdns:108]: mDNS: [15:10:04][C][mdns:109]: Hostname: evse [15:10:04][C][ota:093]: Over-The-Air Updates: [15:10:04][C][ota:094]: Address: evse.local:3232 [15:10:04][C][ota:097]: Using Password. [15:10:04][C][api:138]: API Server: [15:10:04][C][api:139]: Address: evse.local:6053 [15:10:04][C][api:141]: Using noise encryption: YES [15:10:06][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD [15:10:06][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [15:10:06][D][modbus:124]: Ignoring Modbus error - not expecting a response [15:10:06][D][uart_debug:114]: <<< 01:83:02:C0:F1 [15:10:08][D][number:054]: 'PV current' - Setting number value [15:10:08][D][number:113]: New number value: 22.000000 [15:10:08][D][number:012]: 'PV current': Sending state 22.000000 [15:10:08][D][number:054]: 'evse output current setting' - Setting number value [15:10:08][D][number:113]: New number value: 22.000000 [15:10:08][D][uart_debug:114]: >>> 01:10:03:E8:00:01:02:00:16:03:B6 [15:10:08][W][evse_wallbox:058]: Invalid size (4) for EVSE wallbox frame! [15:10:08][W][evse_wallbox:059]: Payload: 03.E8.00.01 [15:10:08][D][uart_debug:114]: <<< 01:10:03:E8:00:01:81:B9 [15:10:11][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [15:10:11][I][evse_wallbox:067]: Config frame received [15:10:11][I][evse_wallbox:083]: Output current default: 32 A [15:10:11][D][number:012]: 'evse output current default': Sending state 32.000000 [15:10:11][I][evse_wallbox:087]: Modbus address: 1 [15:10:11][I][evse_wallbox:089]: Minimum charging current: 0 A [15:10:11][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [15:10:11][I][evse_wallbox:093]: Analog input config: 6 [15:10:11][I][evse_wallbox:095]: Save current on button press: 0 [15:10:11][I][evse_wallbox:114]: PP detection limit: 32 A [15:10:11][I][evse_wallbox:117]: Bootloader version: 3 [15:10:11][I][evse_wallbox:119]: Amps value 1: 0 A [15:10:11][I][evse_wallbox:121]: Amps value 2: 0 A [15:10:11][I][evse_wallbox:123]: Amps value 3: 0 A [15:10:11][I][evse_wallbox:125]: Amps value 4: 0 A [15:10:11][I][evse_wallbox:127]: Amps value 5: 0 A [15:10:11][I][evse_wallbox:129]: Amps value 6: 0 A [15:10:11][I][evse_wallbox:131]: Amps value 7: 0 A [15:10:11][I][evse_wallbox:133]: Amps value 8: 0 A [15:10:11][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4 [15:10:16][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD [15:10:16][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [15:10:16][D][modbus:124]: Ignoring Modbus error - not expecting a response [15:10:16][D][uart_debug:114]: <<< 01:83:02:C0:F1 [15:10:21][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [15:10:21][I][evse_wallbox:067]: Config frame received [15:10:21][I][evse_wallbox:083]: Output current default: 32 A [15:10:21][D][number:012]: 'evse output current default': Sending state 32.000000 [15:10:21][I][evse_wallbox:087]: Modbus address: 1 [15:10:21][I][evse_wallbox:089]: Minimum charging current: 0 A [15:10:21][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [15:10:21][I][evse_wallbox:093]: Analog input config: 6 [15:10:21][I][evse_wallbox:095]: Save current on button press: 0 [15:10:21][I][evse_wallbox:114]: PP detection limit: 32 A [15:10:21][I][evse_wallbox:117]: Bootloader version: 3 [15:10:21][I][evse_wallbox:119]: Amps value 1: 0 A [15:10:21][I][evse_wallbox:121]: Amps value 2: 0 A [15:10:21][I][evse_wallbox:123]: Amps value 3: 0 A [15:10:21][I][evse_wallbox:125]: Amps value 4: 0 A [15:10:21][I][evse_wallbox:127]: Amps value 5: 0 A [15:10:21][I][evse_wallbox:129]: Amps value 6: 0 A [15:10:21][I][evse_wallbox:131]: Amps value 7: 0 A [15:10:21][I][evse_wallbox:133]: Amps value 8: 0 A [15:10:21][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4 [15:10:26][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD [15:10:26][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [15:10:26][D][modbus:124]: Ignoring Modbus error - not expecting a response [15:10:26][D][uart_debug:114]: <<< 01:83:02:C0:F1 [15:10:31][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [15:10:31][I][evse_wallbox:067]: Config frame received [15:10:31][I][evse_wallbox:083]: Output current default: 32 A [15:10:31][D][number:012]: 'evse output current default': Sending state 32.000000 [15:10:31][I][evse_wallbox:087]: Modbus address: 1 [15:10:31][I][evse_wallbox:089]: Minimum charging current: 0 A [15:10:31][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [15:10:31][I][evse_wallbox:093]: Analog input config: 6 [15:10:31][I][evse_wallbox:095]: Save current on button press: 0 [15:10:31][I][evse_wallbox:114]: PP detection limit: 32 A [15:10:31][I][evse_wallbox:117]: Bootloader version: 3 [15:10:31][I][evse_wallbox:119]: Amps value 1: 0 A [15:10:31][I][evse_wallbox:121]: Amps value 2: 0 A [15:10:31][I][evse_wallbox:123]: Amps value 3: 0 A [15:10:31][I][evse_wallbox:125]: Amps value 4: 0 A [15:10:31][I][evse_wallbox:127]: Amps value 5: 0 A [15:10:31][I][evse_wallbox:129]: Amps value 6: 0 A [15:10:31][I][evse_wallbox:131]: Amps value 7: 0 A [15:10:31][I][evse_wallbox:133]: Amps value 8: 0 A [15:10:31][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4 [15:10:36][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD [15:10:36][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [15:10:36][D][modbus:124]: Ignoring Modbus error - not expecting a response [15:10:36][D][uart_debug:114]: <<< 01:83:02:C0:F1 [15:10:41][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [15:10:41][I][evse_wallbox:067]: Config frame received [15:10:41][I][evse_wallbox:083]: Output current default: 32 A [15:10:41][D][number:012]: 'evse output current default': Sending state 32.000000 [15:10:41][I][evse_wallbox:087]: Modbus address: 1 [15:10:41][I][evse_wallbox:089]: Minimum charging current: 0 A [15:10:41][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [15:10:41][I][evse_wallbox:093]: Analog input config: 6 [15:10:41][I][evse_wallbox:095]: Save current on button press: 0 [15:10:41][I][evse_wallbox:114]: PP detection limit: 32 A [15:10:41][I][evse_wallbox:117]: Bootloader version: 3 [15:10:41][I][evse_wallbox:119]: Amps value 1: 0 A [15:10:41][I][evse_wallbox:121]: Amps value 2: 0 A [15:10:41][I][evse_wallbox:123]: Amps value 3: 0 A [15:10:41][I][evse_wallbox:125]: Amps value 4: 0 A [15:10:41][I][evse_wallbox:127]: Amps value 5: 0 A [15:10:41][I][evse_wallbox:129]: Amps value 6: 0 A [15:10:41][I][evse_wallbox:131]: Amps value 7: 0 A [15:10:41][I][evse_wallbox:133]: Amps value 8: 0 A [15:10:41][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4
syssi commented 1 year ago

Thanks for your bug report. You device doesn't respond properly to the "read 10 registers starting at register 1000" request. I assume your device just supports around 5 registers. Could you flash this test YAML and provide the log?

substitutions:
  name: evse
  config_name: "${name} config"
  external_components_source: github://syssi/esphome-evse-wallbox@main
  tx_pin: GPIO16
  rx_pin: GPIO17

esphome:
  name: ${name}
  friendly_name: "EVSE Wallbox"

esp32:
  board: lolin32

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

api:
ota:
logger:
  level: DEBUG

uart:
  id: uart0
  baud_rate: 9600
  tx_pin: ${tx_pin}
  rx_pin: ${rx_pin}
  debug:
    direction: BOTH
    dummy_receiver: true

interval:
  - interval: 15s
    then:
      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x01, 0x04, 0x7A]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x02, 0x44, 0x7B]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x03, 0x85, 0xBB]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x04, 0xC4, 0x79]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x05, 0x05, 0xB9]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x06, 0x45, 0xB8]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x07, 0x84, 0x78]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x08, 0xC4, 0x7C]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x09, 0x05, 0xBC]
      - delay: 1s

      - uart.write: [0x01, 0x03, 0x03, 0xE8, 0x00, 0x0A, 0x45, 0xBD]
      - delay: 1s

Thanks in advance!

torfbolt commented 1 year ago

Thanks for the quick response, here's the log output:

[18:40:18][C][logger:293]: Logger:
[18:40:18][C][logger:294]:   Level: DEBUG
[18:40:18][C][logger:295]:   Log Baud Rate: 0
[18:40:18][C][logger:296]:   Hardware UART: UART0
[18:40:18][C][uart.arduino_esp32:108]: UART Bus 1:
[18:40:18][C][uart.arduino_esp32:109]:   TX Pin: GPIO17
[18:40:18][C][uart.arduino_esp32:110]:   RX Pin: GPIO16
[18:40:18][C][uart.arduino_esp32:112]:   RX Buffer Size: 256
[18:40:18][C][uart.arduino_esp32:114]:   Baud Rate: 9600 baud
[18:40:18][C][uart.arduino_esp32:115]:   Data Bits: 8
[18:40:18][C][uart.arduino_esp32:116]:   Parity: NONE
[18:40:18][C][uart.arduino_esp32:117]:   Stop bits: 1
[18:40:18][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C
[18:40:18][C][captive_portal:088]: Captive Portal:
[18:40:18][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:18][C][mdns:108]: mDNS:
[18:40:18][C][mdns:109]:   Hostname: evse
[18:40:18][C][ota:093]: Over-The-Air Updates:
[18:40:18][C][ota:094]:   Address: evse.local:3232
[18:40:18][C][ota:097]:   Using Password.
[18:40:18][C][api:138]: API Server:
[18:40:18][C][api:139]:   Address: evse.local:6053
[18:40:20][C][api:141]:   Using noise encryption: YES
[18:40:20][D][uart_debug:114]: >>> 01:03:03:E8:00:09:05:BC
[18:40:20][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:20][D][uart_debug:114]: >>> 01:03:03:E8:00:01:04:7A
[18:40:20][D][uart_debug:114]: <<< 01:03:02:00:03:F8:45
[18:40:20][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD
[18:40:20][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:20][D][api:102]: Accepted 10.0.0.6
[18:40:20][D][api.connection:920]: Home Assistant 2023.4.1 (10.0.0.6): Connected successfully
[18:40:20][D][uart_debug:114]: >>> 01:03:03:E8:00:02:44:7B
[18:40:21][D][uart_debug:114]: <<< 01:03:04:00:03:00:05:CA:30
[18:40:21][D][uart_debug:114]: >>> 01:03:03:E8:00:03:85:BB
[18:40:22][D][uart_debug:114]: <<< 01:03:06:00:03:00:05:00:02:F4:B5
[18:40:22][D][uart_debug:114]: >>> 01:03:03:E8:00:04:C4:79
[18:40:23][D][uart_debug:114]: <<< 01:03:08:00:03:00:05:00:02:00:20:CA:CF
[18:40:23][D][uart_debug:114]: >>> 01:03:03:E8:00:05:05:B9
[18:40:24][D][uart_debug:114]: <<< 01:03:0A:00:03:00:05:00:02:00:20:00:00:1D:4C
[18:40:24][D][uart_debug:114]: >>> 01:03:03:E8:00:06:45:B8
[18:40:25][D][uart_debug:114]: <<< 01:03:0C:00:03:00:05:00:02:00:20:00:00:00:0A:81:64
[18:40:25][D][uart_debug:114]: >>> 01:03:03:E8:00:07:84:78
[18:40:26][D][uart_debug:114]: <<< 01:03:0E:00:03:00:05:00:02:00:20:00:00:00:0A:00:03:A3:BB
[18:40:26][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C
[18:40:27][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:27][D][uart_debug:114]: >>> 01:03:03:E8:00:09:05:BC
[18:40:28][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:28][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD
[18:40:29][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:34][D][uart_debug:114]: >>> 01:03:03:E8:00:01:04:7A
[18:40:35][D][uart_debug:114]: <<< 01:03:02:00:03:F8:45
[18:40:35][D][uart_debug:114]: >>> 01:03:03:E8:00:02:44:7B
[18:40:36][D][uart_debug:114]: <<< 01:03:04:00:03:00:05:CA:30
[18:40:36][D][uart_debug:114]: >>> 01:03:03:E8:00:03:85:BB
[18:40:37][D][uart_debug:114]: <<< 01:03:06:00:03:00:05:00:02:F4:B5
[18:40:37][D][uart_debug:114]: >>> 01:03:03:E8:00:04:C4:79
[18:40:38][D][uart_debug:114]: <<< 01:03:08:00:03:00:05:00:02:00:20:CA:CF
[18:40:38][D][uart_debug:114]: >>> 01:03:03:E8:00:05:05:B9
[18:40:39][D][uart_debug:114]: <<< 01:03:0A:00:03:00:05:00:02:00:20:00:00:1D:4C
[18:40:39][D][uart_debug:114]: >>> 01:03:03:E8:00:06:45:B8
[18:40:40][D][uart_debug:114]: <<< 01:03:0C:00:03:00:05:00:02:00:20:00:00:00:0A:81:64
[18:40:40][D][uart_debug:114]: >>> 01:03:03:E8:00:07:84:78
[18:40:41][D][uart_debug:114]: <<< 01:03:0E:00:03:00:05:00:02:00:20:00:00:00:0A:00:03:A3:BB
[18:40:41][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C
[18:40:42][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:42][D][uart_debug:114]: >>> 01:03:03:E8:00:09:05:BC
[18:40:43][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:43][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD
[18:40:44][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:49][D][uart_debug:114]: >>> 01:03:03:E8:00:01:04:7A
[18:40:50][D][uart_debug:114]: <<< 01:03:02:00:03:F8:45
[18:40:50][D][uart_debug:114]: >>> 01:03:03:E8:00:02:44:7B
[18:40:51][D][uart_debug:114]: <<< 01:03:04:00:03:00:05:CA:30
[18:40:51][D][uart_debug:114]: >>> 01:03:03:E8:00:03:85:BB
[18:40:52][D][uart_debug:114]: <<< 01:03:06:00:03:00:05:00:02:F4:B5
[18:40:52][D][uart_debug:114]: >>> 01:03:03:E8:00:04:C4:79
[18:40:53][D][uart_debug:114]: <<< 01:03:08:00:03:00:05:00:02:00:20:CA:CF
[18:40:53][D][uart_debug:114]: >>> 01:03:03:E8:00:05:05:B9
[18:40:54][D][uart_debug:114]: <<< 01:03:0A:00:03:00:05:00:02:00:20:00:00:1D:4C
[18:40:54][D][uart_debug:114]: >>> 01:03:03:E8:00:06:45:B8
[18:40:55][D][uart_debug:114]: <<< 01:03:0C:00:03:00:05:00:02:00:20:00:00:00:0A:81:64
[18:40:55][D][uart_debug:114]: >>> 01:03:03:E8:00:07:84:78
[18:40:56][D][uart_debug:114]: <<< 01:03:0E:00:03:00:05:00:02:00:20:00:00:00:0A:00:03:A3:BB
[18:40:56][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C
[18:40:57][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:57][D][uart_debug:114]: >>> 01:03:03:E8:00:09:05:BC
[18:40:58][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:40:58][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD
[18:40:59][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:41:04][D][uart_debug:114]: >>> 01:03:03:E8:00:01:04:7A
[18:41:05][D][uart_debug:114]: <<< 01:03:02:00:03:F8:45
[18:41:05][D][uart_debug:114]: >>> 01:03:03:E8:00:02:44:7B
[18:41:06][D][uart_debug:114]: <<< 01:03:04:00:03:00:05:CA:30
[18:41:06][D][uart_debug:114]: >>> 01:03:03:E8:00:03:85:BB
[18:41:07][D][uart_debug:114]: <<< 01:03:06:00:03:00:05:00:02:F4:B5
[18:41:07][D][uart_debug:114]: >>> 01:03:03:E8:00:04:C4:79
[18:41:08][D][uart_debug:114]: <<< 01:03:08:00:03:00:05:00:02:00:20:CA:CF
[18:41:08][D][uart_debug:114]: >>> 01:03:03:E8:00:05:05:B9
[18:41:09][D][uart_debug:114]: <<< 01:03:0A:00:03:00:05:00:02:00:20:00:00:1D:4C
[18:41:09][D][uart_debug:114]: >>> 01:03:03:E8:00:06:45:B8
[18:41:10][D][uart_debug:114]: <<< 01:03:0C:00:03:00:05:00:02:00:20:00:00:00:0A:81:64
[18:41:10][D][uart_debug:114]: >>> 01:03:03:E8:00:07:84:78
[18:41:11][D][uart_debug:114]: <<< 01:03:0E:00:03:00:05:00:02:00:20:00:00:00:0A:00:03:A3:BB
[18:41:11][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C
[18:41:12][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:41:12][D][uart_debug:114]: >>> 01:03:03:E8:00:09:05:BC
[18:41:13][D][uart_debug:114]: <<< 01:83:02:C0:F1
[18:41:13][D][uart_debug:114]: >>> 01:03:03:E8:00:0A:45:BD
[18:41:14][D][uart_debug:114]: <<< 01:83:02:C0:F1
syssi commented 1 year ago

It looks like retrieving register 1000 to 1007 works fine:

[18:40:55][D][uart_debug:114]: >>> 01:03:03:E8:00:07:84:78
[18:40:56][D][uart_debug:114]: <<< 01:03:0E:00:03:00:05:00:02:00:20:00:00:00:0A:00:03:A3:BB

As soon as we retrieve register 1008 the device denys the request:

[18:40:56][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C
[18:40:57][D][uart_debug:114]: <<< 01:83:02:C0:F1

I will prepare a fix!

syssi commented 1 year ago

Please update the external_componentssection to retrieve the feature branchshort-status`:

external_components:
  - source: github://syssi/esphome-evse-wallbox@short-status
    refresh: 0s

and recompile/flash your ESP. Please provide a log of the updated setup.

torfbolt commented 1 year ago

Unfortunately doesn't look like it fixed the issue:

Details [19:42:40][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4 [19:42:45][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C [19:42:45][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [19:42:45][D][modbus:124]: Ignoring Modbus error - not expecting a response [19:42:45][D][uart_debug:114]: <<< 01:83:02:C0:F1 [19:42:50][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [19:42:50][I][evse_wallbox:067]: Config frame received [19:42:50][I][evse_wallbox:083]: Output current default: 32 A [19:42:50][D][number:012]: 'evse output current default': Sending state 32.000000 [19:42:50][I][evse_wallbox:087]: Modbus address: 1 [19:42:50][I][evse_wallbox:089]: Minimum charging current: 0 A [19:42:50][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [19:42:50][I][evse_wallbox:093]: Analog input config: 6 [19:42:50][I][evse_wallbox:095]: Save current on button press: 0 [19:42:50][I][evse_wallbox:114]: PP detection limit: 32 A [19:42:50][I][evse_wallbox:117]: Bootloader version: 3 [19:42:50][I][evse_wallbox:119]: Amps value 1: 0 A [19:42:50][I][evse_wallbox:121]: Amps value 2: 0 A [19:42:50][I][evse_wallbox:123]: Amps value 3: 0 A [19:42:50][I][evse_wallbox:125]: Amps value 4: 0 A [19:42:50][I][evse_wallbox:127]: Amps value 5: 0 A [19:42:50][I][evse_wallbox:129]: Amps value 6: 0 A [19:42:50][I][evse_wallbox:131]: Amps value 7: 0 A [19:42:50][I][evse_wallbox:133]: Amps value 8: 0 A [19:42:50][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4 [19:42:55][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C [19:42:55][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [19:42:55][D][modbus:124]: Ignoring Modbus error - not expecting a response [19:42:55][D][uart_debug:114]: <<< 01:83:02:C0:F1 [19:43:00][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [19:43:00][I][evse_wallbox:067]: Config frame received [19:43:00][I][evse_wallbox:083]: Output current default: 32 A [19:43:00][D][number:012]: 'evse output current default': Sending state 32.000000 [19:43:00][I][evse_wallbox:087]: Modbus address: 1 [19:43:00][I][evse_wallbox:089]: Minimum charging current: 0 A [19:43:00][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [19:43:00][I][evse_wallbox:093]: Analog input config: 6 [19:43:00][I][evse_wallbox:095]: Save current on button press: 0 [19:43:00][I][evse_wallbox:114]: PP detection limit: 32 A [19:43:00][I][evse_wallbox:117]: Bootloader version: 3 [19:43:00][I][evse_wallbox:119]: Amps value 1: 0 A [19:43:00][I][evse_wallbox:121]: Amps value 2: 0 A [19:43:00][I][evse_wallbox:123]: Amps value 3: 0 A [19:43:00][I][evse_wallbox:125]: Amps value 4: 0 A [19:43:00][I][evse_wallbox:127]: Amps value 5: 0 A [19:43:00][I][evse_wallbox:129]: Amps value 6: 0 A [19:43:00][I][evse_wallbox:131]: Amps value 7: 0 A [19:43:00][I][evse_wallbox:133]: Amps value 8: 0 A [19:43:00][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4 [19:43:05][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C [19:43:05][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [19:43:05][D][modbus:124]: Ignoring Modbus error - not expecting a response [19:43:05][D][uart_debug:114]: <<< 01:83:02:C0:F1 [19:43:10][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [19:43:10][I][evse_wallbox:067]: Config frame received [19:43:10][I][evse_wallbox:083]: Output current default: 32 A [19:43:10][D][number:012]: 'evse output current default': Sending state 32.000000 [19:43:10][I][evse_wallbox:087]: Modbus address: 1 [19:43:10][I][evse_wallbox:089]: Minimum charging current: 0 A [19:43:10][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [19:43:10][I][evse_wallbox:093]: Analog input config: 6 [19:43:10][I][evse_wallbox:095]: Save current on button press: 0 [19:43:10][I][evse_wallbox:114]: PP detection limit: 32 A [19:43:10][I][evse_wallbox:117]: Bootloader version: 3 [19:43:10][I][evse_wallbox:119]: Amps value 1: 0 A [19:43:10][I][evse_wallbox:121]: Amps value 2: 0 A [19:43:10][I][evse_wallbox:123]: Amps value 3: 0 A [19:43:10][I][evse_wallbox:125]: Amps value 4: 0 A [19:43:10][I][evse_wallbox:127]: Amps value 5: 0 A [19:43:10][I][evse_wallbox:129]: Amps value 6: 0 A [19:43:10][I][evse_wallbox:131]: Amps value 7: 0 A [19:43:10][I][evse_wallbox:133]: Amps value 8: 0 A [19:43:10][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4 [19:43:15][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C [19:43:15][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [19:43:15][D][modbus:124]: Ignoring Modbus error - not expecting a response [19:43:15][D][uart_debug:114]: <<< 01:83:02:C0:F1 [19:43:20][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [19:43:20][I][evse_wallbox:067]: Config frame received [19:43:20][I][evse_wallbox:083]: Output current default: 32 A [19:43:20][D][number:012]: 'evse output current default': Sending state 32.000000 [19:43:20][I][evse_wallbox:087]: Modbus address: 1 [19:43:20][I][evse_wallbox:089]: Minimum charging current: 0 A [19:43:20][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [19:43:20][I][evse_wallbox:093]: Analog input config: 6 [19:43:20][I][evse_wallbox:095]: Save current on button press: 0 [19:43:20][I][evse_wallbox:114]: PP detection limit: 32 A [19:43:20][I][evse_wallbox:117]: Bootloader version: 3 [19:43:20][I][evse_wallbox:119]: Amps value 1: 0 A [19:43:20][I][evse_wallbox:121]: Amps value 2: 0 A [19:43:20][I][evse_wallbox:123]: Amps value 3: 0 A [19:43:20][I][evse_wallbox:125]: Amps value 4: 0 A [19:43:20][I][evse_wallbox:127]: Amps value 5: 0 A [19:43:20][I][evse_wallbox:129]: Amps value 6: 0 A [19:43:20][I][evse_wallbox:131]: Amps value 7: 0 A [19:43:20][I][evse_wallbox:133]: Amps value 8: 0 A [19:43:20][D][uart_debug:114]: <<< 01:03:24:00:20:00:01:00:00:00:06:00:00:00:00:00:2A:00:20:00:00:00:03:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:84:F4 [19:43:25][D][uart_debug:114]: >>> 01:03:03:E8:00:08:C4:7C [19:43:25][D][modbus:119]: Modbus error function code: 0x83 exception: 2 [19:43:25][D][modbus:124]: Ignoring Modbus error - not expecting a response [19:43:25][D][uart_debug:114]: <<< 01:83:02:C0:F1 [19:43:30][D][uart_debug:114]: >>> 01:03:07:D0:00:12:C5:4A [19:43:30][I][evse_wallbox:067]: Config frame received [19:43:30][I][evse_wallbox:083]: Output current default: 32 A [19:43:30][D][number:012]: 'evse output current default': Sending state 32.000000 [19:43:30][I][evse_wallbox:087]: Modbus address: 1 [19:43:30][I][evse_wallbox:089]: Minimum charging current: 0 A [19:43:30][D][number:012]: 'evse minimum charging current': Sending state 0.000000 [19:43:30][I][evse_wallbox:093]: Analog input config: 6 [19:43:30][I][evse_wallbox:095]: Save current on button press: 0 [19:43:30][I][evse_wallbox:114]: PP detection limit: 32 A [19:43:30][I][evse_wallbox:117]: Bootloader version: 3 [19:43:30][I][evse_wallbox:119]: Amps value 1: 0 A [19:43:30][I][evse_wallbox:121]: Amps value 2: 0 A [19:43:30][I][evse_wallbox:123]: Amps value 3: 0 A [19:43:30][I][evse_wallbox:125]: Amps value 4: 0 A [19:43:30][I][evse_wallbox:127]: Amps value 5: 0 A [19:43:30][I][evse_wallbox:129]: Amps value 6: 0 A [19:43:30][I][evse_wallbox:131]: Amps value 7: 0 A [19:43:30][I][evse_wallbox:133]: Amps value 8: 0 A
syssi commented 1 year ago

Ups! My fault. I've pushed another change. Please recompile & flash another time.

torfbolt commented 1 year ago

Yep, now it works. Just the firmware version is reported as 1.0, whereas other interfaces reported it as 10. But I'm not even sure what number it officially is.

syssi commented 1 year ago

It is possible to update the device?

syssi commented 1 year ago

@torfbolt Could you do me a favor and do another test? Please flash this YAML:

substitutions:
  name: evse
  config_name: "${name} config"
  tx_pin: GPIO16
  rx_pin: GPIO17

esphome:
  name: ${name}

esp32:
  board: lolin32

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

api:
ota:
logger:
  level: DEBUG

uart:
  id: uart0
  baud_rate: 9600
  tx_pin: ${tx_pin}
  rx_pin: ${rx_pin}
  debug:
    direction: BOTH
    dummy_receiver: true

interval:
  - interval: 2s
    then:
      - uart.write: [0x01, 0x03, 0x03, 0xEF, 0x00, 0x01, 0xB5, 0xBB]

It requests register 1007 priodically. This is the RCD status register. I would like to make sure your device is unable to respond to register 1007 requests always. Thanks in advance!

syssi commented 1 year ago

Your firmware revision (10) is supported by the main branch now. Please add your firmware version to the YAML:

evse_wallbox:
  id: evse0
  modbus_id: modbus0
  update_interval: 2s
  firmware_version: 10

This avoids retrieving unsupported registers which where introduced in revision 16.

torfbolt commented 1 year ago

Log output from the test yaml:

Details [22:30:39][C][mdns:108]: mDNS: [22:30:39][C][mdns:109]: Hostname: evse [22:30:39][C][ota:093]: Over-The-Air Updates: [22:30:39][C][ota:094]: Address: evse.local:3232 [22:30:39][C][ota:097]: Using Password. [22:30:39][C][api:138]: API Server: [22:30:39][C][api:139]: Address: evse.local:6053 [22:30:39][C][api:141]: Using noise encryption: YES [22:30:40][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:40][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:42][D][api:102]: Accepted 10.0.0.6 [22:30:42][D][api.connection:920]: Home Assistant 2023.4.4 (10.0.0.6): Connected successfully [22:30:42][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:42][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:44][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:44][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:46][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:46][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:48][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:48][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:50][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:50][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:52][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:52][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:54][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:54][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:56][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:56][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:30:58][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:30:58][D][uart_debug:114]: <<< 01:83:02:C0:F1 [22:31:00][D][uart_debug:114]: >>> 01:03:03:EF:00:01:B5:BB [22:31:00][D][uart_debug:114]: <<< 01:83:02:C0:F1
syssi commented 1 year ago

Thanks! Your firmware version doesn't support register 1007 for sure.