Changing a PowMr10k setting via HomeAssistant Modbus issue!

Hello all:
I’ve been trying for a few days to figure out why the “On Time charge/discharge” parameters # 46 /53 for POW-SunSmart 10K or Time slot (segment) charging functions cannot be controlled through Home Assistant.
All other features shown below can be controlled, and respond with no issues via a switch: or a select: platform, except for both Time/segments charge and discharge change requests.


I’m using the following code:

I keep getting the following log component each time I try to change the state from Home Assistant. I can always change the State on the inverter, and the changes update accordingly on Home Assistant but each time I try from the Home Assistant UI, I get the red error message with no change taking place:

I’ve tried to introduce some delay between readings and writings, according to similar issues listed online but not to avail. I’ve been looking all over for a solution, but no success. Any advice on where the error is.
Cheers,
HH.

Have you tried this for troubleshooting?

I just added the integration and I’m trying to figure out how to interface it with the ESP 32 IP being used to communicate the inverter’s parameters over Wi-Fi to home assistant. Is there a way to connect wirelessly with the SP 32 being used?

Using ESPHome for your ESP32?
Do you have the web_server option in your yaml? Go to that address from the ‘visit’ option on your ESPHome screen and see what is being shown.
Post your yaml if you want suggestions.

I’ve been using the “Visit” option at ESPHome screen. The issue there I cannot stop the log from scrolling, but I can use Logs instead from ESPHome screen, where I can stop the log continuous update and I can scroll up and down. I got the the Modbus error function code: 0x6 exception: 11 as showing above on the log each time I try to enable or disable the “Segment Charge Enable”, first item listed under select: I also tried it using a switch option, with and without the use_write_multiple: as follow:

switch:                                                     
# Segment Charge Enable                            # 0: Disable, 1: Enable
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "segment_charge_option"
   # use_write_multiple: true #REMOVED
    address: 0xE02C
    register_type: holding
    bitmask: 1
    entity_category: config #ADDED
    icon: "mdi:toggle-switch"

Here is the yaml file.

substitutions:
  name: "pm10k"
  friendly_name: "PM 10k"
  settings_skipped_updates: "30"
  tx_pin: GPIO16
  rx_pin: GPIO17

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  min_version: 2024.6.0
  project:
    name: "max.esphome-pow"
    version: 1.0.0

esp32:
  board: esp32dev
  framework:
    type: esp-idf

logger:

api:
  encryption:
    key: ""

ota:
  - platform: esphome
    password: ""

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

  ap:
    ssid: "Pm10Kw Fallback Hotspot"
    password: ""

captive_portal:
web_server:
  port: 80

uart:
  - id: uart_powmr
    baud_rate: 9600
    tx_pin: ${tx_pin}
    rx_pin: ${rx_pin}

modbus:
  - id: modbus_powmr
    uart_id: uart_powmr
    send_wait_time: 200ms
  
modbus_controller:
  - id: powmr_cntrl
    address: 0x01
    modbus_id: modbus_powmr
    command_throttle: 300ms
    update_interval: 30s

time:
  - platform: sntp

switch: 

  - platform: restart 
    name: "PM10k Restart"
    id: powmr_restart
    restore_mode: ALWAYS_OFF
 
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "energy-saving mode"
    use_write_multiple: true
    address: 0xE20C
    register_type: holding
    bitmask: 1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "overload automatic restart"
    use_write_multiple: true
    address: 0xE20D
    register_type: holding
    bitmask: 1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "over temperature automatic restart"
    use_write_multiple: true
    address: 0xE20E
    register_type: holding
    bitmask: 1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "overload transfer to bypass enabled"
    use_write_multiple: true
    address: 0xE212
    register_type: holding
    bitmask: 1

sensor:
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Battery charge total"
    id: battery_charge_energy_total
    address: 0xF034
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "Ah"
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Battery Discharge total"
    id: battery_discharge_energy_total
    address: 0xF036
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "Ah"
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1  

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Load consum energy total"
    id: load_consum_energy_total
    address: 0xF03A
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "PV Energy Day"
    id: pv_energy_day
    address: 0xF000
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "PV generate energy total"
    id: pv_generate_energy_total
    address: 0xF038
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Grid Current A"
    id: gi_a 
    address: 0x214
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "A"
    device_class: voltage
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
  
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Main Charging Current"
    id: main_charging_current 
    address: 0x21E
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "A"
    device_class: voltage
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Grid Current B"
    id: gi_b
    address: 0x238
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "A"
    device_class: voltage
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
  
  - platform: template
    name: "Grid Power A"
    id: gp_a 
    unit_of_measurement: "W"
    device_class: power
    state_class: measurement
    accuracy_decimals: 0
    update_interval: "15s"
    lambda: |-
      return 122 * id(gi_a).state;

  - platform: template
    name: "Grid Power B"
    id: gp_b 
    unit_of_measurement: "W"
    device_class: power
    state_class: measurement
    accuracy_decimals: 0
    update_interval: "15s"
    lambda: |-
      return 122 * id(gi_b).state;  

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Grid Charge Current Setting Value"
    id: grid_charge_setting 
    address: 0xE205
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "A"
    device_class: current
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "PV Voltage 39"
    id: pv_voltage_39
    address: 0x10F
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "V"
    device_class: voltage
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
  
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "PV Current 39"
    id: pv_current_39
    address: 272
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "C"
    device_class: voltage
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "PV Voltage 40"
    id: pv_voltage_40
    address: 0x107
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "V"
    device_class: voltage
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
  
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "PV Power 39"
    id: pv_power_39
    address: 0x111
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "W"
    device_class: power
    state_class: measurement
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "PV Power 40"
    id: pv_power_40
    address: 0x109
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "W"
    device_class: power
    state_class: measurement
    accuracy_decimals: 1
  
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "PV Current 40"
    id: pv_current_40
    address: 0x108
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "V"
    device_class: voltage
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Battery Voltage"
    id: battery_voltage
    address: 0x0101
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "V"
    device_class: voltage
    state_class: measurement
    accuracy_decimals: 2
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Battery SoC"
    accuracy_decimals: 0
    unit_of_measurement: "%"
    device_class: battery
    address: 0x0100
    register_type: holding
    value_type: U_WORD
    state_class: measurement

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Battery Current"
    id: battery_current
    address: 0x0102
    register_type: holding
    value_type: S_WORD
    unit_of_measurement: "A"
    device_class: current
    state_class: measurement
    accuracy_decimals: 2
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Load Current A"
    id: load_current_a
    address: 0x219
    register_type: holding
    unit_of_measurement: "A"
    device_class: current
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Load Current B"
    id: load_current_b
    address: 0x230
    register_type: holding
    unit_of_measurement: "A"
    device_class: current
    state_class: measurement
    accuracy_decimals: 1
    filters:
      - multiply: 0.1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Load VA A"
    id: load_va_a
    address: 540
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "VA"
    device_class: apparent_power
    state_class: measurement
    accuracy_decimals: 0

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Load VA B"
    id: load_va_b
    address: 564
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "VA"
    device_class: apparent_power
    state_class: measurement
    accuracy_decimals: 0   

  - platform: template
    name: "Load Power A"
    id: load_power_a
    unit_of_measurement: "W"
    device_class: power
    state_class: measurement
    accuracy_decimals: 0
    update_interval: 10s
    lambda: |-
      return id(load_current_a).state * 120;
  
  - platform: template
    name: "Load Power B"
    id: load_power_b
    unit_of_measurement: "W"
    device_class: power
    state_class: measurement
    accuracy_decimals: 0
    update_interval: 10s
    lambda: |-
      return id(load_current_b).state * 120;

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Max Utility Charging Current D"
    accuracy_decimals: 0
    entity_category: diagnostic
    address: 0xE205
    register_type: holding
    value_type: U_WORD
    unit_of_measurement: "A"
    filters:
      - multiply: 0.1
 
binary_sensor:
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Alarm"
    entity_category: diagnostic
    address: 57872
    register_type: holding
    bitmask: 0x100

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Restart On Overload"
    entity_category: diagnostic
    address: 57869
    register_type: holding
    bitmask: 0x800

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Restart On Overheat"
    entity_category: diagnostic
    address: 57870
    register_type: holding
    bitmask: 0x1000

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Overload Bypass"
    entity_category: diagnostic
    address: 57874
    register_type: holding
    bitmask: 0x8000

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Grid and Mixed Load Enabled"
    address: 57399
    register_type: holding
    bitmask: 0x4000

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Grid Active"
    id: grid_active
    address: 57885
    register_type: holding
    bitmask: 0x8000

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "On Battery"
    address: 258
    register_type: holding
    bitmask: 0x1

select:
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Segment Charge Enable"
    skip_updates: ${settings_skipped_updates}
    entity_category: config
    address: 0xE02C
    value_type: U_WORD
    optionsmap:
      "Disable": 0
      "Enable": 1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Segment Discharge Enable"
    skip_updates: ${settings_skipped_updates}
    entity_category: config
    address: 0xE033
    value_type: U_WORD
    optionsmap:
      "Disable": 0
      "Enable": 1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Input Change Beep"
    optimistic: true
    skip_updates: ${settings_skipped_updates}
    entity_category: config
    address: 0xE211
    value_type: U_WORD
    optionsmap:
      "Off": 0
      "On": 1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Overload Bypass"
    optimistic: true
    skip_updates: ${settings_skipped_updates}
    entity_category: config
    address: 0xE212
    value_type: U_WORD
    optionsmap:
      "Off": 0
      "On": 1

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    id: charger_source_priority_select
    name: "Charging Source Priority"
    optimistic: true
    skip_updates: ${settings_skipped_updates}
    force_new_range: true
    entity_category: config
    address: 0xE20
    value_type: U_WORD
    optionsmap:
      "Solar First CSO": 0
      "Grid First CUB": 1      
      "Solar n Grid SNU": 2
      "Only Solar OSO": 3

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    id: output_source_priority_select
    name: "Output Source Priority"
    optimistic: true
    skip_updates: ${settings_skipped_updates}
    entity_category: config
    address: 0xE204
    value_type: U_WORD
    optionsmap:
      "Solar first SOL": 0
      "Utility first UTI": 1  
      "Solar n Batt SBU": 2

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Max Charge Current"
    optimistic: true
    skip_updates: ${settings_skipped_updates}
    entity_category: config
    address: 0xE20A
    value_type: U_WORD
    optionsmap:
      "10": 100
      "20": 200
      "30": 300
      "40": 400
      "50": 500
      "60": 600
      "70": 700
      "80": 800
      "85": 850
      "90": 900
      "95": 950
      "100": 1000
      "105": 1050
      "110": 1100
      "115": 1150
      "120": 1200

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "Utility Charge Current"
    optimistic: true
    skip_updates: ${settings_skipped_updates}
    entity_category: config
    address: 0xE205
    value_type: U_WORD
    optionsmap:
      "0": 0
      "5": 50
      "10": 100
      "15": 150
      "20": 200
      "25": 250
      "30": 300
      "35": 350
      "40": 400
      "45": 450
      "50": 500
      "55": 550
      "60": 600
      "65": 650
      "70": 700
      "75": 750
      "80": 800

number:
  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "max PV charging current Setting"
    use_write_multiple: true
    address: 0xE001
    register_type: holding
    value_type: U_WORD
    min_value: 0.0
    max_value: 100.0
    step: 0.1
    unit_of_measurement: "A"
    lambda: "return x * 0.1f;"
    write_lambda: |-
      return x * 10.0f;

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "maximum charging current"
    use_write_multiple: true
    address: 0xE20A
    register_type: holding
    value_type: U_WORD
    min_value: 0.0
    max_value: 100.0
    step: 0.1
    unit_of_measurement: "A"
    lambda: "return x * 0.1f;"
    write_lambda: |-
      return x * 10.0f;

  - platform: modbus_controller
    modbus_controller_id: powmr_cntrl
    name: "maximum Utility charging current"
    use_write_multiple: true
    address: 0xE205
    register_type: holding
    value_type: U_WORD
    min_value: 0.0
    max_value: 100.0
    step: 0.1
    unit_of_measurement: "A"
    lambda: "return x * 0.1f;"
    write_lambda: |-
      return x * 10.0f;

On casual reading the very first line if your yaml might be a comment, but isnt.

I fixed it, just cut cut and paste

All registers are reporting and responding fine except the two segments, 9th and 10th from the bottom of the table

I just enabled the discharge and get the following

I I have been trying the protocol wizard integration you have suggested and I don’t have wired access to the inverter. Trying to figure out how to interface the wizard protocol with the ESP 32 IP being used to communicate the inverter’s parameters over Wi-Fi to home assistant. Is there a way to connect wirelessly with the SP 32 being used?

Is this something that also sneaked in from the example?

The comment part was in a line between switch: and -platform I’ve edited that part above

I’ve added the switch part to the yaml file to test if it would work, as an alternative to the select: “segment” component but it didn’t.

The MODBUS error is the controller is not responding. Go back and look at the documentation - are the values U_WORD valid? Are the addresses correct? Is the category correct?

I first doubted the addresses, but I verified that by changing their status on the inverter and subsequently their status will change on the ESPhome interface. I’m trying figuring out values U_WORD. It might be the issue for this register is boolean.

Compare to the above, could they have to be the same?

They’re not the same; this one is E20C and the other one is E02C

Sorry, not the address, I mean “select” vs “switch”. Should all three be the same?

I didn’t get it, what are the three that should be the same?
I have tried to modify register E02C using both the switch option and the select option and I could not modify it through the ESPhome user interface. For some reason, the inverter is not accepting the request for this particular register. It’s no problem for the others register which are similar/boolean.

Is it actually supported by your device?

Doing a bit of a deeper dive:

Can you point me to the document you extracted your register values from? Is it this one: PowMr-POW-SunSmart-12KL3-RS485-HomeAssistant-Integration/docs at master · ByteSeekerPro/PowMr-POW-SunSmart-12KL3-RS485-HomeAssistant-Integration · GitHub

From the user manual (https://community.powmr.com/wp-content/uploads/2025/05/POW-SunSmart-10K-POW-SunSmart-10KP-User-Manual_Parallel-Version_V.1.7.0418.pdf) on page 36 I read (my emphasis in bold):
5.7 Time-slot Charging/Discharging Function
The POW-SunSmart series is equipped with a time-slot charging and discharging function, which
allows users to set different charging and discharging periods according to the local peak and
valley tariffs, so that the utility power and PV energy can be used rationally.
When mains electricity is expensive, the battery inverter is used to carry the load; when the mains
electricity is cheap, the mains electricity is used to carry the load and charge, which can help
customers to save electricity costs to the greatest extent.
The user can turn on/off the time-slot charging/discharging function in setup menu parameter 46
and 53
. and set charging and discharging slot in parameter 40-45 and 47-52. You can set
corresponding periods based on the local time-of-use price. Below are examples for users to
understand the function"

These parameters seem to be documented on page 30 and 31.

I also see some more information in the following:

which tends to indicate there should be some more values that are missing with time slots, etc.

Is the correct date and time set in parameters 54 and 55?

Worth reading: GitHub · Where software is built
and GitHub - ByteSeekerPro/PowMr-POW-SunSmart-12KL3-RS485-HomeAssistant-Integration: ByteSeekerPro Repository

See Tested working: POW-SunSmart 10K · Issue #9 · ByteSeekerPro/PowMr-POW-SunSmart-12KL3-RS485-HomeAssistant-Integration · GitHub for encouragement.

I couldn’t reply earlier. I was prevented by the system since I’m new here. I have to wait several hours to be allowed in again.
It is a long story. I have had, for a couple of years, a much shorter yamel program for just reading registers of various currents, voltages, powers, and SOC. I recall that I extracted the register addresses from the iPower desktop .exe program that PowMr service has sent me in the past, when I first bought the inverter. The iPower app was associated with a SERNE similar inverter, but many of the addresses were the wrong ones for the inverter I have.
I didn’t know at that time that I could also write to these registers. After an exhaustive correspondence with PowMr/support, who advised me to get their Wi-Fi dongle for communication, but I wasn’t able to tie it to Home Assistant, and let go of it.
Lately, one of my New Year’s resolutions, due to the current/winter low solar energy supply, was to put together some automations triggered by solar conditions and the house energy demand to enable controlling the charging current and the timeslots for charging the batteries when the electric $rate is discounted.
I initially sought the new register addresses from a YouTube video made by the same company, “How to Integrate PowMr Inverter with Home Assistant 2,” with 2 yamel files included. Despite the claim that these files would work for the 10K inverter, many of the addresses were incorrect. I corresponded again with much frustration with the manufacturer, and finally, after at least 7 correspondences, I received on the 8th the same document (-.MODBUS.-V2.04.2.2.pdf), that you had pointed to.
I am at the point where the only options I cannot control are those two darn registers for turning on and off the timeslot charging and discharging.
I don’t care much about the discharging; I do not need it, but I’m after the remotely enabling and disabling, which would not work. I was trying for several days to figure this out online and by testing different programming options. I am more of a retired mechanical engineer in the thermal science side and not much in networking and computer programming stuff, but I’m trying.