Skip to content

GamesterUnknown/PowMR_ESPHome

Repository files navigation

My ESPHome PowMr Hybrid Inverter

This is modifiyed updated version of ESPHome PowMr Hybrid Inverter(https://github.com/odya/esphome-powmr-hybrid-inverter).

What was changed:

  1. All sensors combined in one file.
  2. Corrected query and calculation of Power and Power Factor
  3. Optimied Modbus registers query:
    1. 14 registers starting from 4502
    2. 19 registers starting from 4516
    3. 19 registers starting from 4539
    4. config registers (starting from 5002) are read one by one in other case it will not read values.

Known issues:

  1. Using text_sensor instead of regular sensor lead to hang of ESP immidiatly after start. Root case unknown.
  2. In some cases ESP hang after otp update via WiFI.

Compatibility

All models that are supported by the WIFI-VM device should work:

Tested models

  • POW-HVM3.2H-24V
  • POW-HVM6.2M-48V

Connection

PowMr ESP32 connection diagram

ESP8266

This configuration can be used on the ESP8266, but you won't be able to use all the sensors due to the memory limitations of the ESP8266. You can use minimal set of sensors/selects, leaving only the ones you need. You can use "Heap size" sensor of Debug module to determine how much free memory left. Looks like minimum heap size, that ensures stability, is near 6Kb. Although I still strongly recommend using ESP32. Also Ota upgrade might be failed due to absent of EEPROM memory for downloading update. In such case use USB or WEB firmare update.

Usage

  1. Create new project subdirectory within your ESPHome configuration directory (let it be powmr-inverter, for example)
  2. Copy the contents of the src repo folder to a newly created project directory.
  3. Now, the main.yaml file must be located under <esphome_config>/powmr-inverter
  4. Create file powmr-inverter.yaml in the esphome config directory root and copy contents of example config
  5. Edit substitutions & customize powmr-inverter.yaml. You can add contents of common_system & common_sensors to this file or include them separately following the example.
  6. Flash firmware to your ESP32

PZEM module

In version 1.2, a PZEM module was added for measuring parameters of the input AC grid. If you do not wish to use it, comment out the include of the corresponding module in the main.yaml file.

Inverter card

For easy integration into Home Assistant, you can use the examples of inverter cards. The following custom plugins are required: sunsynk-power-flow-card, stack-in-card, tabbed-card, canary.

Optimize modbus communications

ESPHome reads sequential Modbus registers in one batch. If you have gaps in register addresses, you need to use the register_count parameter to skip N registers and continue the batch. Details in ESPHome docs.

You can debug your register ranges by setting the global log level to VERBOSE and muting all "noisy" components except the modbus_controller.

logger:
  level: VERBOSE
  logs:
    component: ERROR # Fix for issue #4717 "Component xxxxxx took a long time for an operation"
    modbus_controller: VERBOSE
    modbus_controller.text_sensor: WARN
    modbus_controller.sensor: WARN
    modbus_controller.binary_sensor: WARN
    modbus_controller.select: WARN

After this, the ranges map will be printed in the logs:

[15:55:14][C][modbus_controller:307]: ranges
[18:41:21][C][modbus_controller:307]: ranges
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x1196 count=37 skip_updates=0
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x11BC count=16 skip_updates=0
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x138A count=1 skip_updates=2
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x138F count=1 skip_updates=2
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x1391 count=1 skip_updates=2
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x1399 count=1 skip_updates=2
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x139A count=1 skip_updates=2
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x139E count=1 skip_updates=2
[18:41:21][C][modbus_controller:310]:   Range type=3 start=0x13A0 count=1 skip_updates=2

In the example above, the sensor registers batches starts from 0x1196 & 0x11BC (one large batch causes data errors). Select registers starts from 0x138A. Using batches for selects triggers Modbus device set offline warning messages, so you need to read them separately.

You will see gaps in register ranges map. To calculate register_count, you need to convert HEX addresses to decimal and subtract them.

UART debugging

  • Uncomment debug section in modules/inverter.yaml or modules/pzem.yaml to enable the debug output of the UART component
      # debug:
      #   direction: BOTH
      #   dummy_receiver: false
    
  • Increase the log level to DEBUG or VERBOSE
    logger:
      level: WARN
    

Notes

References & thanks

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages