Write to inverter help

I have connected my SRNE inverter to Home Assistant through ESPHome. It can read the values & display in my dashboard.

Now what I want to do is to change the inverter parameters through Home Assistant and/or automation. (ex. change the Output priority from SBU to UTI)

There’s an registry entry with read/write for this setting as below.

It correctly read the current output priority setting as 2 (which is for SBU)

Is it possible to write the value back to inverter through Home Assistant so that I can change the output priority? Since I’m with 0 knowledge in coding, can someone please help me with this?

You probably need to have a read of this:

Then re-post your question with “Modbus” in the title, to catch the eye of the Modbus experts amongst us (I am not one).

1 Like
User
esphome:
  name: srne
  friendly_name: SRNE

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "+EMWnue33wLGXOUUcZdBgtEcWOJjQIPoN7E3WbVj2UA="

ota:
  password: "27a70d64573b33d2dc248577739abfa5"


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: 192.168.1.16
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.1.16
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.1.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0

uart:
 id: mod_bus
 tx_pin: 19
 rx_pin: 18
 baud_rate: 9600
 stop_bits: 1
 
modbus:
 id: tdt1_modbus
 flow_control_pin: 4
 
modbus_controller:
 - id: srne1
   address: 0x01
   modbus_id: tdt1_modbus
   setup_priority: -10
   update_interval: 15000ms #data refresh rate

switch:
  - platform: template
    name: "Output Priority Switch"
    id: output_priority_switch
    turn_on_action:
      - modbus.write_register:
          id: tdt1_modbus
          address: 0xE204
          value: 1
    turn_off_action:
      - modbus.write_register:
          id: tdt1_modbus
          address: 0xE204
          value: 0

sensor:

 - platform: modbus_controller
   modbus_controller_id: srne1
   name: "Output Priority" #name for HA
   id: srne_output_priority #id for HA
   register_type: holding
   address: 0xE204 #register address 

When I enter like this I get an error saying

switch.template: [source /config/esphome/srne.yaml:52]
platform: template
name: Output Priority Switch
id: output_priority_switch
turn_on_action:
-
Unable to find action with the name ‘modbus.write_register’.
modbus.write_register:
id: tdt1_modbus
address: 57860
value: 1

Please help

Hi Dimu,

Did you find a find a solution for this and are you able to set the Output priority of the inverter remotely now?
I am trying the same thing with a generic python modus script. I am able to configure the energy save mode (E20C) but all other RW parameters return a 0BH error (insufficient permissions) when I try to write to them. I noticed that the iPow Software from SRNE can’t set these either, also contacted their customer support with no success. There might an additional step required in order to acquire the permission.

No have not found a solution yet