syssi / esphome-pipsolar

ESPHome component to monitor and control a pipsolar inverter via RS232
Apache License 2.0
89 stars 39 forks source link

EAsun ISolar SMH 3K - gets the answer on one line #36

Closed Damianb0 closed 1 year ago

Damianb0 commented 1 year ago

I have an inverter model as in the title. I connected it with HA via Nodemcu V3 ESP8266 and RS TTL MAX3232cse converter. I connected the TX / RX pin with ESP to the RX / TX converter. Then I connected RJ45 to the inverter with three pins. Only with this physical configuration do I get any responses from the inverter that look like this:

> INFO Reading configuration /config/esphome/easun.yaml...
> INFO Detected timezone 'Europe/Warsaw'
> INFO Starting log output from easun.local using esphome API
> INFO Successfully connected to easun.local
> [10:40:56][I][app:102]: ESPHome version 2022.10.1 compiled on Nov  8 2022, 09:41:51
> [10:40:56][C][wifi:502]: WiFi:
> [10:40:56][C][wifi:360]:   Local MAC: C8:C9:A3:5C:85:0D
> [10:40:56][C][wifi:361]:   SSID: 'DeBraders'[redacted]
> [10:40:56][C][wifi:362]:   IP Address: 192.168.1.236
> [10:40:56][C][wifi:363]:   BSSID: 9C:9D:7E:15:DB:A3[redacted]
> [10:40:56][C][wifi:365]:   Hostname: 'easun'
> [10:40:56][C][wifi:367]:   Signal strength: -76 dB ▂▄▆█
> [10:40:56][C][wifi:371]:   Channel: 6
> [10:40:56][C][wifi:372]:   Subnet: 255.255.255.0
> [10:40:56][C][wifi:373]:   Gateway: 192.168.1.1
> [10:40:56][C][wifi:374]:   DNS1: 192.168.1.1
> [10:40:56][C][wifi:375]:   DNS2: 0.0.0.0
> [10:40:56][C][logger:275]: Logger:
> [10:40:56][C][logger:276]:   Level: DEBUG
> [10:40:56][C][logger:277]:   Log Baud Rate: 0
> [10:40:56][C][logger:278]:   Hardware UART: UART1
> [10:40:56][C][uart.arduino_esp8266:102]: UART Bus:
> [10:40:56][C][uart.arduino_esp8266:103]:   TX Pin: GPIO1
> [10:40:56][C][uart.arduino_esp8266:104]:   RX Pin: GPIO3
> [10:40:56][C][uart.arduino_esp8266:106]:   RX Buffer Size: 256
> [10:40:56][C][uart.arduino_esp8266:108]:   Baud Rate: 2400 baud
> [10:40:56][C][uart.arduino_esp8266:109]:   Data Bits: 8
> [10:40:56][C][uart.arduino_esp8266:110]:   Parity: NONE
> [10:40:56][C][uart.arduino_esp8266:111]:   Stop bits: 1
> [10:40:56][C][uart.arduino_esp8266:113]:   Using hardware serial interface.
> [10:40:56][C][pipsolar:860]: Pipsolar:
> [10:40:56][C][pipsolar:861]: used commands:
> [10:40:56][C][pipsolar:864]: QPIRI
> [10:40:56][C][pipsolar:864]: QPIGS
> [10:40:56][C][web_server:125]: Web Server:
> [10:40:56][C][web_server:126]:   Address: easun.local:80
> [10:40:56][C][mdns:100]: mDNS:
> [10:40:56][C][mdns:101]:   Hostname: easun
> [10:40:56][D][pipsolar:755]: timeout command to poll: QPIRI
> [10:40:56][C][ota:089]: Over-The-Air Updates:
> [10:40:56][C][ota:090]:   Address: easun.local:8266
> [10:40:56][C][ota:093]:   Using Password.
> [10:40:56][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
> [10:40:56][D][pipsolar:836]: Sending polling command : QPIGS with length 5
> [10:40:57][C][api:138]: API Server:
> [10:40:57][C][api:139]:   Address: easun.local:6053
> [10:40:57][C][api:141]:   Using noise encryption: YES
> [10:40:57][C][sntp:050]: SNTP Time:
> [10:40:57][C][sntp:051]:   Server 1: '0.pool.ntp.org'
> [10:40:57][C][sntp:052]:   Server 2: '1.pool.ntp.org'
> [10:40:57][C][sntp:053]:   Server 3: '2.pool.ntp.org'
> [10:40:57][C][sntp:054]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
> [10:40:57][D][uart_debug:158]: <<< "(001.0 00.0 228.0 50.0 0000 0000 000 406 27.21 000 100 0471 0001 066.6 27.07 00000 10010110 00 04 00045 100)\e\r"
> [10:40:57][D][pipsolar:772]: checking crc on incoming message
> [10:40:57][D][pipsolar:781]: CRC NOK expected: 67 B3 but got: 0 0
> [10:40:57][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
> [10:40:58][D][pipsolar:836]: Sending polling command : QPIRI with length 5
> [10:40:58][D][uart_debug:158]: <<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"
> [10:41:02][D][pipsolar:755]: timeout command to poll: QPIRI
> [10:41:03][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
> [10:41:03][D][pipsolar:836]: Sending polling command : QPIGS with length 5
> [10:41:03][D][uart_debug:158]: <<< "(001.0 00.0 228.0 50.0 0000 0000 000 407 27.24 000 100 0471 0001 066.6 27.09 00000 10010110 00 04 00042 100\xDCr\r"
> [10:41:08][D][pipsolar:755]: timeout command to poll: QPIGS
> [10:41:08][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
> [10:41:08][D][pipsolar:836]: Sending polling command : QPIRI with length 5
> [10:41:08][D][uart_debug:158]: <<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"
> [10:41:13][D][pipsolar:755]: timeout command to poll: QPIRI
> [10:41:13][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
> [10:41:13][D][pipsolar:836]: Sending polling command : QPIGS with length 5
> [10:41:13][D][uart_debug:158]: <<< "(001.0 00.0 228.0 50.0 0000 0000 000 407 27.24 000 100 0471 0001 066.6 27.09 00000 10010110 00 04 00045 100\xBB\xA6\r"
> [10:41:18][D][pipsolar:755]: timeout command to poll: QPIGS
> [10:41:18][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
> [10:41:18][D][pipsolar:836]: Sending polling command : QPIRI with length 5
> [10:41:18][D][uart_debug:158]: <<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"
> [10:41:23][D][pipsolar:755]: timeout command to poll: QPIRI
> [10:41:23][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
> [10:41:23][D][pipsolar:836]: Sending polling command : QPIGS with length 5
> [10:41:23][D][uart_debug:158]: <<< "(001.0 00.0 229.0 50.0 0000 0000 000 407 27.24 000 100 0471 0001 066.6 27.09 00000 10010110 00 04 00048 100FQ\r"
> [10:41:28][D][pipsolar:755]: timeout command to poll: QPIGS
> [10:41:28][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
> [10:41:28][D][pipsolar:836]: Sending polling command : QPIRI with length 5
> [10:41:28][D][uart_debug:158]: <<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"
> [10:41:33][D][pipsolar:755]: timeout command to poll: QPIRI
> [10:41:33][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
> [10:41:33][D][pipsolar:836]: Sending polling command : QPIGS with length 5
> [10:41:33][D][uart_debug:158]: <<< "(001.0 00.0 228.0 50.0 0000 0000 000 407 27.24 000 100 0471 0001 066.6 27.10 00000 10010110 00 04 00042 100\xE2\x9A\r"
> [10:41:38][D][pipsolar:755]: timeout command to poll: QPIGS
> [10:41:38][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
> [10:41:38][D][pipsolar:836]: Sending polling command : QPIRI with length 5
> [10:41:38][D][uart_debug:158]: <<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"
> [10:41:43][D][pipsolar:755]: timeout command to poll: QPIRI
> [10:41:43][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
> [10:41:43][D][pipsolar:836]: Sending polling command : QPIGS with length 5
> [10:41:43][D][uart_debug:158]: <<< "(001.0 00.0 228.0 50.0 0000 0000 000 407 27.24 000 100 0471 0001 066.7 27.11 00000 10010110 00 04 00039 100{\xF9\r"
> [10:41:48][D][pipsolar:755]: timeout command to poll: QPIGS
> [10:41:48][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
> [10:41:48][D][pipsolar:836]: Sending polling command : QPIRI with length 5
> [10:41:48][D][uart_debug:158]: <<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"
> [10:41:53][D][pipsolar:755]: timeout command to poll: QPIRI
> [10:41:53][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
> [10:41:53][D][pipsolar:836]: Sending polling command : QPIGS with length 5
> [10:41:53][D][uart_debug:158]: <<< "(001.0 00.0 228.0 50.0 0000 0000 000 407 27.29 000 100 0471 0001 066.7 27.12 00000 10010110 00 04 00039 100\xFA=\r"
> [10:41:58][D][pipsolar:755]: timeout command to poll: QPIGS
> [10:41:58][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
> [10:41:58][D][pipsolar:836]: Sending polling command : QPIRI with length 5
> [10:41:58][D][uart_debug:158]: <<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"
> [10:42:03][D][pipsolar:755]: timeout command to poll: QPIRI
> [10:42:03][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
> [10:42:03][D][pipsolar:836]: Sending polling command : QPIGS with length 5
> [10:42:03][D][uart_debug:158]: <<< "(001.0 00.0 228.0 50.0 0000 0000 000 408 27.29 000 100 0471 0001 066.8 27.13 00000 10010110 00 04 00048 100i\x8B\r"
> [10:42:08][D][pipsolar:755]: timeout command to poll: QPIGS
> [10:42:08][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
> [10:42:08][D][pipsolar:836]: Sending polling command : QPIRI with length 5
> [10:42:08][D][uart_debug:158]: <<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"

This is what my HA configuration file looks like:

substitutions:
  name: pipsolar

esphome:
  name: easun
  platform: ESP8266
  board: nodemcuv2

logger:
  baud_rate: 0
  hardware_uart: uart1

api:
  encryption:
    key:

ota:
  password: 

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

  ap:
    ssid: 
    password: 

web_server:
  port: 80

uart:
  id: uart0
  baud_rate: 2400
  tx_pin: GPIO1
  rx_pin: GPIO3
  debug:
    direction: BOTH
    dummy_receiver: true
    after:
      delimiter: "\r"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

pipsolar:
  uart_id: uart0
  id: inverter0

sensor:
  - platform: pipsolar
    pipsolar_id: inverter0

    # QPIRI
    grid_rating_voltage:
      name: "${name} grid_rating_voltage"
    battery_rating_voltage:
      name: "${name} battery_rating_voltage"
      id: inverter0_battery_rating_voltage

    current_max_ac_charging_current:
      name: "${name} current_max_ac_charging_current"
    current_max_charging_current:
      name: "${name} current_max_charging_current"
    pv_ok_condition_for_parallel:
      name: "${name} pv_ok_condition_for_parallel"
    pv_power_balance:
      name: "${name} pv_power_balance"

    # QPIGS
    grid_voltage:
      name: "${name} grid_voltage"
    grid_frequency:
      name: "${name} grid_frequency"
    ac_output_voltage:
      name: "${name} ac_output_voltage"
    ac_output_frequency:
      name: "${name} ac_output_frequency"
    ac_output_apparent_power:
      name: "${name} ac_output_apparent_power"
    ac_output_active_power:
      name: "${name} ac_output_active_power"
    output_load_percent:
      name: "${name} output_load_percent"
    bus_voltage:
      name: "${name} bus_voltage"
    battery_voltage:
      name: "${name} battery_voltage"
    battery_charging_current:
      name: "${name} battery_charging_current"
    battery_capacity_percent:
      name: "${name} battery_capacity_percent"
    inverter_heat_sink_temperature:
      name: "${name} inverter_heat_sink_temperature"
    pv_input_current_for_battery:
      name: "${name} pv_input_current_for_battery"
      id: inverter0_offgrid_pv_input_current_for_battery
    pv_input_voltage:
      name: "${name} pv_input_voltage"
    battery_voltage_scc:
      name: "${name} battery_voltage_scc"
      id: inverter0_offgrid_battery_voltage_scc
    battery_discharge_current:
      name: "${name} battery_discharge_current"
    battery_voltage_offset_for_fans_on:
      name: "${name} battery_voltage_offset_for_fans_on"
    pv_charging_power:
      name: "${name} pv_charging_power"

output:
  - platform: pipsolar
    pipsolar_id: inverter0
    battery_recharge_voltage:
      id: inverter0_battery_recharge_voltage_out
  - platform: pipsolar
    pipsolar_id: inverter0
    current_max_ac_charging_current:
      id: current_max_ac_charging_current
  - platform: pipsolar
    pipsolar_id: inverter0
    current_max_charging_current:
      id: current_max_charging_current

time:
  - platform: sntp
    id: my_time

I tried to connect the inverter to WatchPower. Then I had to reverse pin 1 and 2 in RJ45 so that it would return something on the console, but the program did not connect, it did not detect the inverter. But when I opened putty, after pressing enter I got "(NAKss"

Damianb0 commented 1 year ago

I have replaced the RS-TTL converter, but the logs look the same

[09:23:38][D][pipsolar:836]: Sending polling command : QPIRI with length 5

[09:23:43][D][pipsolar:755]: timeout command to poll: QPIRI

[09:23:43][D][pipsolar:836]: Sending polling command : QPIGS with length 5

[09:23:48][D][pipsolar:755]: timeout command to poll: QPIGS

[09:23:48][D][pipsolar:836]: Sending polling command : QPIRI with length 5

[09:23:53][D][pipsolar:755]: timeout command to poll: QPIRI

[09:23:53][D][pipsolar:836]: Sending polling command : QPIGS with length 5

Is it possible that the ESP is corrupted and therefore not decoding the responses? Does the timeout mean that there is no complete response from the inverter after all?

Damianb0 commented 1 year ago

I get this log when I replace the contents of the yaml file from esp8266-test-protocols.yaml

Do I understand correctly that ESP should decode the inverter response and send it to the HA? If so, what's wrong with these logos? The inverter returns something wrong or maybe something is missing in the ESP?

I am asking for at least a hint.

syssi commented 1 year ago

The esp8266-test-protocols.yaml just sends requests/commands of different known protocols to your inverter and prints the responses to the log. This configuration should help you to identify the supported protocol(s) of you inverter.

It looks like your inverter responds properly to the PI41 protocol which is supported by pipsolar. Please use this configuration example as next step: https://github.com/syssi/esphome-pipsolar/blob/main/esp8266-example.yaml

And provide some additional debug output if it doesn't work out of the box. The component retrieves/requests periodically some data from the inverter and can publish the measurements a sensor values and controle entities via MQTT or using the native Home Assistant API.

Damianb0 commented 1 year ago

Thank you for your response

I used the recommended sample configuration and my file now looks like this:

substitutions: name: pipsolar

esphome: name: ${name} platform: ESP8266 board: nodemcuv2

logger: baud_rate: 0 hardware_uart: uart1

api: encryption: key: "6VJNXQQa3gGhiO/O3XonXFfUZKqMsqM8a+/xkWgGwQA="

ota: password: "692e49e9f476ae52acae38ca7f629828"

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

ap: ssid: "Easun Fallback Hotspot" password: "8ihPx3tkYiqB"

web_server: port: 80

uart: id: uart0 baud_rate: 2400 tx_pin: GPIO1 rx_pin: GPIO3 debug: direction: BOTH dummy_receiver: true after: delimiter: "\r" sequence:

  • lambda: UARTDebug::log_string(direction, bytes);

pipsolar: uart_id: uart0 id: inverter0

sensor:

  • platform: pipsolar pipsolar_id: inverter0 grid_voltage: name: "${name} grid_voltage" grid_frequency: name: "${name} grid_frequency" ac_output_voltage: name: "${name} ac_output_voltage" ac_output_frequency: name: "${name} ac_output_frequency" ac_output_apparent_power: name: "${name} ac_output_apparent_power" ac_output_active_power: name: "${name} ac_output_active_power" output_load_percent: name: "${name} output_load_percent" bus_voltage: name: "${name} bus_voltage" battery_voltage: name: "${name} battery_voltage" battery_charging_current: name: "${name} battery_charging_current" battery_capacity_percent: name: "${name} battery_capacity_percent" inverter_heat_sink_temperature: name: "${name} inverter_heat_sink_temperature" pv_input_current_for_battery: name: "${name} pv_input_current_for_battery" pv_input_voltage: name: "${name} pv_input_voltage" battery_voltage_scc: name: "${name} battery_voltage_scc" battery_discharge_current: name: "${name} battery_discharge_current" battery_voltage_offset_for_fans_on: name: "${name} battery_voltage_offset_for_fans_on" pv_charging_power: name: "${name} pv_charging_power"

text_sensor:

  • platform: pipsolar pipsolar_id: inverter0 device_mode: name: "${name} device_mode"

binary_sensor:

  • platform: pipsolar pipsolar_id: inverter0 add_sbu_priority_version: name: "${name} add_sbu_priority_version" configuration_status: name: "${name} configuration_status" load_status: name: "${name} load_status" battery_voltage_to_steady_while_charging: name: "${name} battery_voltage_to_steady_while_charging" charging_status: name: "${name} charging_status" scc_charging_status: name: "${name} scc_charging_status" ac_charging_status: name: "${name} ac_charging_status" charging_to_floating_mode: name: "${name} charging_to_floating_mode" switch_on: name: "${name} switch_on" silence_buzzer_open_buzzer: name: "${name} silence_buzzer_open_buzzer" overload_bypass_function: name: "${name} overload_bypass_function" lcd_escape_to_default: name: "${name} lcd_escape_to_default" overload_restart_function: name: "${name} overload_restart_function" over_temperature_restart_function: name: "${name} over_temperature_restart_function"

switch:

  • platform: pipsolar pipsolar_id: inverter0 output_source_priority_utility: name: "${name} output_source_priority_utility" output_source_priority_solar: name: "${name} output_source_priority_solar" output_source_priority_battery: name: "${name} output_source_priority_battery" input_voltage_range: name: "${name} input_voltage_range" pv_ok_condition_for_parallel: name: "${name} pv_ok_condition_for_parallel" pv_power_balance: name: "${name} pv_power_balance"

output:

  • platform: pipsolar pipsolar_id: inverter0 battery_recharge_voltage: id: inverter0_battery_recharge_voltage_out

And the output log from ESP:

INFO Successfully connected to pipsolar.local [17:05:25][I][app:102]: ESPHome version 2022.10.1 compiled on Nov 10 2022, 15:29:34

[17:05:25][C][wifi:360]: Local MAC: C8:C9:A3:5C:85:0D [17:05:25][C][wifi:361]: SSID: [redacted] [17:05:25][C][wifi:362]: IP Address: 192.168.1.236 [17:05:25][C][wifi:363]: BSSID: [redacted]

[17:05:25][C][wifi:367]: Signal strength: -66 dB ▂▄▆█ [17:05:25][C][wifi:371]: Channel: 6 [17:05:25][C][wifi:372]: Subnet: 255.255.255.0 [17:05:25][C][wifi:373]: Gateway: 192.168.1.1 [17:05:25][C][wifi:374]: DNS1: 192.168.1.1 [17:05:25][C][wifi:375]: DNS2: 0.0.0.0

[17:05:25][C][logger:276]: Level: DEBUG [17:05:25][C][logger:277]: Log Baud Rate: 0 [17:05:25][C][logger:278]: Hardware UART: UART1 [17:05:25][C][uart.arduino_esp8266:102]: UART Bus: [17:05:25][C][uart.arduino_esp8266:103]: TX Pin: GPIO1 [17:05:25][C][uart.arduino_esp8266:104]: RX Pin: GPIO3 [17:05:25][C][uart.arduino_esp8266:106]: RX Buffer Size: 256 [17:05:25][C][uart.arduino_esp8266:108]: Baud Rate: 2400 baud [17:05:25][C][uart.arduino_esp8266:109]: Data Bits: 8 [17:05:25][C][uart.arduino_esp8266:110]: Parity: NONE [17:05:25][C][uart.arduino_esp8266:111]: Stop bits: 1 [17:05:25][C][uart.arduino_esp8266:113]: Using hardware serial interface.

[17:05:25][C][pipsolar:861]: used commands:

[17:05:25][C][pipsolar.switch:010]: Pipsolar Switch 'pipsolar output_source_priority_utility'

[17:05:25][C][pipsolar.switch:010]: Pipsolar Switch 'pipsolar output_source_priority_solar'

[17:05:25][C][pipsolar.switch:010]: Pipsolar Switch 'pipsolar output_source_priority_battery'

[17:05:25][C][pipsolar.switch:010]: Pipsolar Switch 'pipsolar input_voltage_range'

[17:05:25][C][pipsolar.switch:010]: Pipsolar Switch 'pipsolar pv_ok_condition_for_parallel'

[17:05:25][C][pipsolar.switch:010]: Pipsolar Switch 'pipsolar pv_power_balance'

[17:05:25][C][web_server:125]: Web Server: [17:05:25][C][web_server:126]: Address: pipsolar.local:80

[17:05:25][C][mdns:101]: Hostname: pipsolar [17:05:25][C][ota:089]: Over-The-Air Updates: [17:05:25][C][ota:090]: Address: pipsolar.local:8266 [17:05:25][C][ota:093]: Using Password. [17:05:25][C][api:138]: API Server: [17:05:25][C][api:139]: Address: pipsolar.local:6053 [17:05:25][C][api:141]: Using noise encryption: YES [17:05:29][D][pipsolar:755]: timeout command to poll: QMOD

[17:05:29][D][pipsolar:836]: Sending polling command : QFLAG with length 5

[17:05:34][D][pipsolar:755]: timeout command to poll: QFLAG

[17:05:34][D][pipsolar:836]: Sending polling command : QPIRI with length 5

[17:05:39][D][pipsolar:755]: timeout command to poll: QPIRI

[17:05:39][D][pipsolar:836]: Sending polling command : QPIGS with length 5

[17:05:44][D][pipsolar:755]: timeout command to poll: QPIGS

[17:05:44][D][pipsolar:836]: Sending polling command : QMOD with length 4

[17:05:49][D][pipsolar:755]: timeout command to poll: QMOD

[17:05:49][D][pipsolar:836]: Sending polling command : QFLAG with length 5

[17:05:51][D][api:102]: Accepted 192.168.1.21 [17:05:51][W][api.connection:071]: 192.168.1.21: Socket operation failed: CONNECTION_CLOSED errno=11 [17:05:54][D][pipsolar:755]: timeout command to poll: QFLAG

[17:05:54][D][pipsolar:836]: Sending polling command : QPIRI with length 5

[17:05:59][D][pipsolar:755]: timeout command to poll: QPIRI

[17:05:59][D][pipsolar:836]: Sending polling command : QPIGS with length 5

[17:06:04][D][pipsolar:755]: timeout command to poll: QPIGS

[17:06:04][D][pipsolar:836]: Sending polling command : QMOD with length 4

[17:06:09][D][pipsolar:755]: timeout command to poll: QMOD

[17:06:09][D][pipsolar:836]: Sending polling command : QFLAG with length 5

[17:06:14][D][pipsolar:755]: timeout command to poll: QFLAG

[17:06:14][D][pipsolar:836]: Sending polling command : QPIRI with length 5

One new thing is api.connection errno=11. This was not exist before. However, still nothing is returned to the HA. All entities with ESP are inaccessible

image

syssi commented 1 year ago

I will check the QPIGS response tomorrow. It looks a bit suspicious because of the minus sign. It's possible pipsolar doesn't support this kind of response ((230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0) because it's special in some advance.

Damianb0 commented 1 year ago

Then there is some hope that it will start working. However, I wonder about the answer for QPIRI "(226.0 50.0 226.0 50.0 0000 0000 000 393 25.04 000 033 0625 0000 000.0 25.00 00000 10010000 00 04 00000 000\x17O\r" because there is no minus sign, and yet it also generates a timeout. It is true that I found documentation communication over the RS232 interface, but for InfiniSolar there is a different amount of data in the response. Thank you for your help, because I didn't know where to look for the reason why something was not working, which theoretically should.

Damianb0 commented 1 year ago

If it turns out that this will not work, is it possible to add individual fields from the response as entities in HA one by one?

syssi commented 1 year ago

Do you have access to the protocol description of your inverter?

Damianb0 commented 1 year ago

I will ask the seller. He sent me a link to his surveillance software a few days ago, but I can't access it http://solarmonitorsystem.com/

syssi commented 1 year ago

The important parts of the traffic capture above:

>>> "QPIRI\xF8T\r"
<<< "(230.0 01.3 230.0 50.0 01.3 3000 2400 24.0 24.5 23.5 28.8 27.0 2 20 20 0 1 4 - 01 1 0 27.0 0 0\xAF\x10\r"

>>> "QPIGS\xB7\xA9\r"
<<< "(226.0 50.0 226.0 50.0 0000 0000 000 393 25.04 000 033 0625 0000 000.0 25.00 00000 10010000 00 04 00000 000\x17O\r"
<<< "(227.0 50.0 227.0 50.0 0000 0000 000 393 25.04 000 033 0624 0000 000.0 25.00 00000 10010000 00 04 00000 000q"\r"

>>> "QMODI\xC1\r"
<<< "(L\x06\a\r"

>>> "QFLAG\x98t\r"
<<< "(EauxzDbjkvy\xBF#\r"
syssi commented 1 year ago

Please set this line dummy_receiver: true to false. This should fix the timeout issues.

syssi commented 1 year ago

The protocol of your inverter is supported by the official pipsolar component of ESPHome. At the moment the dummy_receiver consumes the responses from the RX buffer and the pipsolar component is unable to receive/process the responses because they are stolen (by the dummy receiver).

Damianb0 commented 1 year ago

It works! I am very grateful for your help. I didn't expect there could be a problem here, but I'm not very familiar with these protocols either. I think this will be a big tip for other users of these inverters with a similar problem.

[09:35:03][D][sensor:126]: 'pipsolar battery_capacity_percent': Sending state 69.00000 % with 1 decimals of accuracy [09:35:03][D][sensor:126]: 'pipsolar inverter_heat_sink_temperature': Sending state 657.00000 °C with 1 decimals of accuracy [09:35:03][D][sensor:126]: 'pipsolar pv_input_current_for_battery': Sending state 0.00000 A with 1 decimals of accuracy [09:35:03][D][sensor:126]: 'pipsolar pv_input_voltage': Sending state 28.60000 V with 1 decimals of accuracy [09:35:03][D][sensor:126]: 'pipsolar battery_voltage_scc': Sending state 25.69000 V with 1 decimals of accuracy [09:35:03][D][sensor:126]: 'pipsolar battery_discharge_current': Sending state 0.00000 A with 1 decimals of accuracy [09:35:03][D][sensor:126]: 'pipsolar battery_voltage_offset_for_fans_on': Sending state 0.00000 V with 1 decimals of accuracy [09:35:03][D][sensor:126]: 'pipsolar pv_charging_power': Sending state 0.00000 W with 1 decimals of accuracy

[09:35:04][D][pipsolar:836]: Sending polling command : QMOD with length 4 [09:35:04][D][sensor:126]: 'offgrid pv_output': Sending state 0.00000 W with 1 decimals of accuracy [09:35:04][D][sensor:126]: 'Total Daily Energy OFFGRID': Sending state 0.00000 kWh with 3 decimals of accuracy

[09:35:04][D][pipsolar:772]: checking crc on incoming message [09:35:04][D][pipsolar:775]: CRC OK [09:35:04][D][pipsolar:471]: Decode QMOD [09:35:04][D][text_sensor:067]: 'pipsolar device_mode': Sending state 'L' [09:35:05][D][sensor:126]: 'offgrid pv_output': Sending state 0.00000 W with 1 decimals of accuracy [09:35:05][D][sensor:126]: 'Total Daily Energy OFFGRID': Sending state 0.00000 kWh with 3 decimals of accuracy

[09:35:05][D][pipsolar:836]: Sending polling command : QFLAG with length 5

syssi commented 1 year ago

I just realized the debug instructions at the README are wrong. I've fixed the instructions and extended the yaml configuration examples to avoid such trouble in future.

sergeyshadow commented 1 year ago

I have replaced the RS-TTL converter, but the logs look the same

[09:23:38][D][pipsolar:836]: Sending polling command : QPIRI with length 5

[09:23:43][D][pipsolar:755]: timeout command to poll: QPIRI

[09:23:43][D][pipsolar:836]: Sending polling command : QPIGS with length 5

[09:23:48][D][pipsolar:755]: timeout command to poll: QPIGS

[09:23:48][D][pipsolar:836]: Sending polling command : QPIRI with length 5

[09:23:53][D][pipsolar:755]: timeout command to poll: QPIRI

[09:23:53][D][pipsolar:836]: Sending polling command : QPIGS with length 5

Is it possible that the ESP is corrupted and therefore not decoding the responses? Does the timeout mean that there is no complete response from the inverter after all?

hello I have a similar problem :(

[22:53:57][D][uart_debug:158]: >>> "QPIRI\xF8T\r"
[22:53:57][D][pipsolar:838]: Sending polling command : QPIRI with length 5
[22:53:57][D][uart_debug:158]: <<< "(230.0 47.8 230.0 50.0 47.8 11000 11000 48.0 46.0 44.0 56.8 55.7 2 010 150 0 2 2 9 01 0 0 54.0 0 1 480 0 000}<\r"
[22:53:57][D][pipsolar:772]: checking crc on incoming message
[22:53:57][D][pipsolar:782]: CRC NOK expected: 78 43 but got: 0 0
[22:53:58][D][uart_debug:158]: >>> "QPIGS\xB7\xA9\r"
[22:53:58][D][pipsolar:838]: Sending polling command : QPIGS with length 5
[22:53:58][D][uart_debug:158]: <<< "(235.4 49.9 235.4 49.9 00164 00055 001 422 53.70 010 095 0036 00.0 000.0 00.00 00000 00010101 00 00 00000 010\xED\x99\r"
[22:54:03][D][pipsolar:755]: timeout command to poll: QPIGS
[22:54:03][D][uart_debug:158]: >>> "QMODI\xC1\r"
[22:54:03][D][pipsolar:838]: Sending polling command : QMOD with length 4
[22:54:03][D][uart_debug:158]: <<< "(L\x06\a\r"

Apparently my inverter does not support pipsolar protocols?

`[22:45:51][D][uart_debug:158]: >>> "^P003PI\r"
[22:45:53][D][uart_debug:158]: >>> "^P005PIq\xC2\x8B\r"
[22:45:55][D][uart_debug:158]: >>> "QPI\xC2\xBE\xC2\xAC\r"
[22:45:57][D][uart_debug:158]: >>> "QDIq\e\r"
[22:45:59][D][uart_debug:158]: >>> "QPIRI\xC3\xB8T\r"
[22:46:01][D][uart_debug:158]: >>> "QPIGS\xC2\xB7\xC2\xA9\r"
[22:46:03][D][uart_debug:158]: >>> "QMODI\xC3\x81\r"
[22:46:05][D][uart_debug:158]: >>> "QFLAG\xC2\x98t\r"
[22:46:19][D][uart_debug:158]: >>> "QPI\r"`