Skip to content

Write support

Richard Pearce edited this page Jan 26, 2024 · 1 revision

Note: This is still of a work in progress I have only tested desired_power and energy_storage_mode.

By default the script will listen to the following topics:

  sofar/rw/eps_control
  sofar/rw/remote_on_off_control
  sofar/rw/power_control
  sofar/rw/active_power_export_limit
  sofar/rw/active_power_import_limit
  sofar/rw/reactive_power_setting
  sofar/rw/power_factor_setting
  sofar/rw/active_power_limit_speed
  sofar/rw/reactive_power_response_time
  sofar/rw/energy_storage_mode
  sofar/rw/time_of_use_charge_soc
  sofar/rw/passive_timeout
  sofar/rw/passive_timeout_action
  sofar/rw/desired_power
  sofar/rw/minimum_battery_power
  sofar/rw/maximum_battery_power
  sofar/rw/desired_power_grid

Note: sofar/rw is configurable via the --write-topic option.

# Install the mosquitto clients
sudo apt install mosquitto-clients

# Dump 1kW from the battery (inverter does nothing unless it is in Passive mode)
$ mosquitto_pub -h localhost -t sofar/rw/desired_power -m "-1000"

# Example output (/var/log/syslog)
INFO - Received a request for desired_power to set value to: -1000(-1000)
INFO - Writing 0x1187(4487) with -1000(-1000)
INFO - Modbus Write Request: desired_power successful. Retries: 1

# Set the invert to Passive mode
$ mosquitto_pub -h localhost -t sofar/rw/energy_storage_mode -m "Passive mode"

# Example output (/var/log/syslog)
INFO - Received a request for energy_storage_mode to set value to: Passive mode(3)
INFO - Writing 0x1110(4368) with 3(3)
INFO - Modbus Write Request: energy_storage_mode successful. Retries: 0

You can also do this directly from Home Assistant!

Clone this wiki locally