Skip to content

Instantly share code, notes, and snippets.

@bjeanes
Last active August 25, 2022 07:30
Show Gist options
  • Save bjeanes/9e6865afb10fbeb9f471481b963efdd8 to your computer and use it in GitHub Desktop.
Save bjeanes/9e6865afb10fbeb9f471481b963efdd8 to your computer and use it in GitHub Desktop.
inverter:
host: REPLACEME # [Required] IP Address of the Inverter or Dongle
scan_interval: 1 # [Optional] Default is 30
connection: http # [Required] options: modbus, sungrow, http
model: "SH5.0RS" # [Optional] This is autodetected on startup, only needed if detection issues or for testing
log_console: ERROR # [Optional] Default is WARNING, Options: DEBUG, INFO, WARNING, ERROR
level: 0 # [Optional] Set the amount of information to gather
# 0 = Model and Solar Generation,
# 1 (default) = Useful data, all required for exports,
# 2 everything your Inverter supports,
# 3 Everything from every register
exports:
# Publish Registers to MQTT / Home Assistant
- name: mqtt
enabled: True # [Optional] Default is False
host: core-mosquitto # [Required] IP or Hostname of MQTT Server
# port: 1883 # [Optional] Default 1883
# topic: "inverter/{model}/registers" # [Optional] Default: "inverter/{model}/registers", Variable {model} will be replaced with model number of inverter
username: sungather # [Optional] Username is MQTT server requires it
password: REDACTED # [Optional] Password is MQTT server requires it
# client_id: # [Optional] Client id for mqtt connection. Defaults to "SunGather", need to be set to different values if you want to run multiple instances of sungather.
homeassistant: True # [Optional] Default False, Publish discovery and sensors for HomeAssistant
ha_sensors: # [Optional] / [Required] ha_discovery: True, Topics to enable discovery for HA
- name: "Inverter running state"
sensor_type: sensor
register: running_state
- register: "state_power_generated_from_pv"
sensor_type: binary_sensor
name: "Inverter generating PV"
payload_on: "1"
payload_off: "0"
- register: "state_battery_charging"
sensor_type: binary_sensor
name: "Inverter battery charging"
payload_on: "1"
payload_off: "0"
- register: "state_battery_discharging"
sensor_type: binary_sensor
name: "Inverter battery discharging"
payload_on: "1"
payload_off: "0"
- register: "state_load_active"
sensor_type: binary_sensor
name: "Inverter load active"
payload_on: "1"
payload_off: "0"
- register: "state_feed_into_grid"
sensor_type: binary_sensor
name: "Inverter feeding into grid"
payload_on: "1"
payload_off: "0"
- register: "state_import_from_grid"
sensor_type: binary_sensor
name: "Inverter importing from grid"
payload_on: "1"
payload_off: "0"
- register: "state_power_generated_from_load"
sensor_type: binary_sensor
name: "Inverter charging from grid"
payload_on: "1"
payload_off: "0"
version: 0.2.0
vendor: Sungrow
registers:
- read:
- name: "running_state"
level: 0
address: 13001
datatype: "U16"
models: ["SH5K-20","SH3K6","SH4K6","SH5K-V13","SH5K-30","SH3K6-30","SH4K6-30","SH5.0RS","SH3.6RS","SH4.6RS","SH6.0RS","SH10RT","SH8.0RT","SH6.0RT","SH5.0RT"]
- name: "state_power_generated_from_pv"
level: 0
address: 13001
datatype: "U16"
mask: 1
models: ["SH5K-20","SH3K6","SH4K6","SH5K-V13","SH5K-30","SH3K6-30","SH4K6-30","SH5.0RS","SH3.6RS","SH4.6RS","SH6.0RS","SH10RT","SH8.0RT","SH6.0RT","SH5.0RT"]
- name: "state_battery_charging"
level: 0
address: 13001
datatype: "U16"
mask: 2
models: ["SH5K-20","SH3K6","SH4K6","SH5K-V13","SH5K-30","SH3K6-30","SH4K6-30","SH5.0RS","SH3.6RS","SH4.6RS","SH6.0RS","SH10RT","SH8.0RT","SH6.0RT","SH5.0RT"]
- name: "state_battery_discharging"
level: 0
address: 13001
datatype: "U16"
mask: 4
models: ["SH5K-20","SH3K6","SH4K6","SH5K-V13","SH5K-30","SH3K6-30","SH4K6-30","SH5.0RS","SH3.6RS","SH4.6RS","SH6.0RS","SH10RT","SH8.0RT","SH6.0RT","SH5.0RT"]
- name: "state_load_active"
level: 0
address: 13001
datatype: "U16"
mask: 8
models: ["SH5K-20","SH3K6","SH4K6","SH5K-V13","SH5K-30","SH3K6-30","SH4K6-30","SH5.0RS","SH3.6RS","SH4.6RS","SH6.0RS","SH10RT","SH8.0RT","SH6.0RT","SH5.0RT"]
- name: "state_feed_into_grid"
level: 0
address: 13001
datatype: "U16"
mask: 16
models: ["SH5K-20","SH3K6","SH4K6","SH5K-V13","SH5K-30","SH3K6-30","SH4K6-30","SH5.0RS","SH3.6RS","SH4.6RS","SH6.0RS","SH10RT","SH8.0RT","SH6.0RT","SH5.0RT"]
- name: "state_import_from_grid"
level: 0
address: 13001
datatype: "U16"
mask: 32
models: ["SH5K-20","SH3K6","SH4K6","SH5K-V13","SH5K-30","SH3K6-30","SH4K6-30","SH5.0RS","SH3.6RS","SH4.6RS","SH6.0RS","SH10RT","SH8.0RT","SH6.0RT","SH5.0RT"]
- name: "state_power_generated_from_load"
level: 0
address: 13001
datatype: "U16"
mask: 128
models: ["SH5K-20","SH3K6","SH4K6","SH5K-V13","SH5K-30","SH3K6-30","SH4K6-30","SH5.0RS","SH3.6RS","SH4.6RS","SH6.0RS","SH10RT","SH8.0RT","SH6.0RT","SH5.0RT"]
- hold: []
scan:
- read:
- start: 13000
range: 1
- hold: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment