Dear Joubert,
I connected an ESP8266 connected to the serial (RS232 cable) of an EASUN 8kW Hybrid Inverter and I read correctly the inverter status parameters.
To setup pipsolar current_max_ac_charging_current I adapted your suggested approach and code (see my code).
Now it happens that only in some cases of selected helper values the current_max_ac_charging_current
is recorded in the inverter, in other cases a very different value is transmitted and since it does not belong to the set of allowed values, it is not recorded. Here is the list:
Helper: 2, 10, 20, 30, 40,50, 60, 70,80, 90,100,110,120 Amps
Registration: 153,218,139,188,185,56,103,152,12,131,100,110,120 Amps
Note that only in the cases of setup higher than 100: 100A, 110A, 120A the values are registered in the inverter.
Can You help me ?
Here is the Logs of unsuccessful & successful registration:
[14:00:00][D][main:238]: STARTING VARIABLE ACCurrent
[14:00:00][D][pipsolar.output:015]: Will write: MUCHGC020 out of value 20.000000 / 20
[14:00:00][D][pipsolar:860]: got command: MUCHGC020
[14:00:00][D][pipsolar:851]: Command queued successfully: MUCHGC020 with length 9 at position 0
[14:00:00][D][main:063]: VARIABLE ACCurrent ENDS
[14:00:00][D][uart_debug:158]: >>> “MUCHGC020\xF3\xF1\r”
[14:00:00][D][pipsolar:811]: Sending command from queue: MUCHGC020 with length 9
[14:00:00][W][component:237]: Component esphome.coroutine took a long time for an operation (66 ms).
[14:00:00][W][component:238]: Components should block for at most 30 ms.
[14:00:00][D][uart_debug:158]: <<< “(NAKss\r”
[14:00:00][D][pipsolar:043]: response length for command OK
[14:00:00][D][pipsolar:776]: checking crc on incoming message
[14:00:00][D][pipsolar:779]: CRC OK
[14:00:00][D][pipsolar:049]: command not successful
[14:25:47][D][main:238]: STARTING VARIABLE ACCurrent
[14:25:47][D][pipsolar.output:015]: Will write: MUCHGC0100 out of value 100.000000 / 100
[14:25:47][D][pipsolar:860]: got command: MUCHGC0100
[14:25:47][D][pipsolar:851]: Command queued successfully: MUCHGC0100 with length 10 at position 1
[14:25:47][D][main:063]: VARIABLE ACCurrent ENDS
[14:25:47][D][uart_debug:158]: >>> “MUCHGC0100A\r”
[14:25:47][D][pipsolar:811]: Sending command from queue: MUCHGC0100 with length 10
[14:25:47][W][component:237]: Component esphome.coroutine took a long time for an operation (70 ms).
[14:25:47][W][component:238]: Components should block for at most 30 ms.
[14:25:47][D][uart_debug:158]: <<< “(ACK9 \r”
[14:25:47][D][pipsolar:043]: response length for command OK
[14:25:47][D][pipsolar:776]: checking crc on incoming message
[14:25:47][D][pipsolar:779]: CRC OK
[14:25:47][D][pipsolar:047]: command successful
[14:25:56][D][main:238]: STARTING VARIABLE ACCurrent
[14:25:56][D][pipsolar.output:015]: Will write: MUCHGC010 out of value 10.000000 / 10
[14:25:56][D][pipsolar:860]: got command: MUCHGC010
[14:25:56][D][pipsolar:851]: Command queued successfully: MUCHGC010 with length 9 at position 2
[14:25:56][D][main:063]: VARIABLE ACCurrent ENDS
[14:25:56][D][pipsolar:776]: checking crc on incoming message
[14:25:56][D][pipsolar:779]: CRC OK
[14:25:56][D][pipsolar:483]: Decode QFLAG
[14:25:56][D][uart_debug:158]: >>> “MUCHGC010\xA6\xA2\r”
[14:25:56][D][pipsolar:811]: Sending command from queue: MUCHGC010 with length 9
[14:25:56][W][component:237]: Component esphome.coroutine took a long time for an operation (64 ms).
[14:25:56][W][component:238]: Components should block for at most 30 ms.
[14:25:57][D][uart_debug:158]: <<< “(NAKss\r”
[14:25:57][D][pipsolar:043]: response length for command OK
[14:25:57][D][pipsolar:776]: checking crc on incoming message
[14:25:57][D][pipsolar:779]: CRC OK
[14:25:57][D][pipsolar:049]: command not successful
================================
Here is a fragment of ESPHOME code:
</>
api:
services:
- service: ac_grid_current
variables:
ACCurent: float
then:
- logger.log: “STARTING VARIABLE ACCurrent”
- output.pipsolar.set_level:
id: pipsolar_current_max_ac_charging_current
value: !lambda ‘return ACCurent;’
- logger.log: “VARIABLE ACCurrent ENDS”
output:
- platform: pipsolar
pipsolar_id: inverter0
current_max_ac_charging_current:
possible_values:
- 2
- 10
- 20
- 30
- 40
- 50
- 60
- 70
- 80
- 90
- 100
- 110
- 120
id: pipsolar_current_max_ac_charging_current
</>
================================
Here is the AUTOMATION:
</>
- id: ‘162702835999’
alias: inverter Setting max charging Current
description: ‘’
trigger:
- platform: state
entity_id: input_select.setting_max_charging_current
condition:
action:
- service: esphome.pipsolar_ac_grid_current
data:
ACCurent: “{% if is_state("input_select.setting_max_charging_current", "
2 Amp") %}\n 2 \n{% elif is_state("input_select.setting_max_charging_current"
, "10 Amp") %}\n 10 \n{% elif is_state("input_select.setting_max_charging_current"
, "20 Amp") %}\n 20 \n{% elif is_state("input_select.setting_max_charging_current"
, "30 Amp") %}\n 30 \n{% elif is_state("input_select.setting_max_charging_current"
, "40 Amp") %}\n 40 \n{% elif is_state("input_select.setting_max_charging_current"
, "50 Amp") %}\n 50 \n{% elif is_state("input_select.setting_max_charging_current"
, "60 Amp") %}\n 60 \n{% elif is_state("input_select.setting_max_charging_current"
, "70 Amp") %}\n 70 \n{% elif is_state("input_select.setting_max_charging_current"
, "80 Amp") %}\n 80 \n{% elif is_state("input_select.setting_max_charging_current"
, "90 Amp") %}\n 90 \n{% elif is_state("input_select.setting_max_charging_current"
, "100 Amp") %}\n 100 \n{% elif is_state("input_select.setting_max_charging_current"
, "110 Amp") %}\n 110 \n{% elif is_state("input_select.setting_max_charging_current"
, "120 Amp") %}\n 120 \n{% endif %}\n”
mode: single
</>
================================
And the Helper:
input_select.setting_max_charging_current with the values of
2 Amp, 10 Amp, 20 Amp, 30 Amp,40 Amp,50 Amp,60 Amp,70 Amp,80 Amp,90 Amp,100 Amp,1100 Amp,120 Amp