TL;DR
If you don’t own a Deye inverter + EV charger1, don’t read this. It’s about some obscure settings that control communication of the inverter(register 0x103) with the ev-charger via Lora. It will bore you to death. It also summarizes the debate from github2.
The issue – if you put your nose where it doesn’t belong, you will not charge your beautiful e-car anymore
Deye EV charger is controlled by Deye inverter via Lora or Wifi. Its working parameters can be accessed3 also by Home Assistant4 (via modbus, Solarman integration). But beware, inverter’s 16-bit register 0x103 that contains EV charger’s charging power limit (high 8 bits) and charging mode (low 8 bits) state is tricky. If you write wrong (bit) value to it, you will mess it up and won’t be able to restore it easily (via inverter’s ui or deye app).
What official docs say about this register:
| Addr | Register meaning | R/W | data range | unit | note |
| 259 | EV_charge_mode | R/W | [0x0,0xFFFF] | High 8 bits: Off grid SOC Low 8 bits: Bit0:solar energy only Bit1:free work Bit4:EV_charge device connet at Grid port Bit5:EV_charge device connect at LD port |
But what about undocumented bits 2, 3, 6, 7? Not sure, but it looks these bits contain internal charging/communication state between inverter and ev-charger.
If you set them wrongly (or write for example 0 to the whole register), Lora mode won’t work anymore. Consequentially, ‘solar only’ mode will not work anymore. You have to switch to ‘wifi mode’ to be able to charge at all. Calling Deye to update your firmware will not help. Nasty.
The only known solution (to me) is to restore the state of this register. Firmware update doesn’t help (because it only touches the firmware, not the settings). There are 2 options:
- Write a value that restores the undocumented bits to the register via Deye portal (Device/inverter/Custom command…).
Value: 0110010300010232ee238F
That sends 0x32EE to register 0x0103, which decodes as:
Power Mode: Free Work Inverter Port: Load Port Off-Grid SOC: 50%
+ sets undocumented bits to the right state
After executing this command you’ll be able to set the charger to your preferred mode again.
Or
2. Write the same value as above using Home Assistant + Solarman integration + custom sensor yaml for that specific register.
- edit Solarman’s definition file for your inverter: config/custom components/solarman/inverter definitions/deye_p3.yaml and add
# charger state raw
- name: EV Charger State raw
alt: EV Charger State raw
platform: number
class: ""
state_class: "measurement"
uom: ""
scale: 1
rule: 1
registers: [0x0103]
configurable:
min: 0
max: 65535
range:
min: 0
max: 65535Restart HA, and a new numeric input box will appear among your solarman’s entities (EV charger state raw).
Enter the decimal value 13038 in the input box of this entity, enter, and that will set the correct bits to the register 0x103. Then, comment out this entity in the yaml file so you don’t f***up it again.
The day is saved, inverter will be able to talk to ev-charger via lora again.
Don’t ask me how I know. Fairies told me, that’s how 🙂
*the correct way of manipulating this register is by: read-modify-write (in a way that preserves previous bit state)
Footnotes
- This post is related to the following equipment:
Inverter: SUN-12K-SG04LP3-EU, MAIN:2006-1183-1807,HMI:1001-C072, Protocol Version:0104, LSW3_32_5406_SS_04_00.00.00.0B
EV charger: SUN-EVSE22K01-EU-AC, MW4_01_5429_SS_04_00.00.00.07 ↩︎ - Debate on Github (also, about Solarman’s integration upgrade to support controlling EV charger via modbus): https://github.com/davidrapan/ha-solarman/discussions/731#discussioncomment-17431450 ↩︎
- beside traditional ways: inverter’s screen, deye mobile app or deye’s web portal ↩︎
- I wrote about it in https://blog.rozman.info/integrating-deye-ev-charger-to-home-assistant/ ↩︎