Skip to content

Commit

Permalink
Merge pull request #44 from MartinJSa/MartinJSa-HomeAssistant
Browse files Browse the repository at this point in the history
Add systemIO_power and update MQTT syntax
  • Loading branch information
cmcgerty authored Nov 21, 2022
2 parents 9de1412 + 456cf82 commit f8c7667
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Home Assistant example/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#Sofar ME3000SP Sofar2mqtt sensors
#Updated to now include the new MQTT sensors required for 2022.12 release of Home Assistant onwards
sensor:
- platform: integration
name: Energy_from_battery
Expand Down Expand Up @@ -83,6 +84,18 @@ mqtt:
{% else %}
{{ (value_json.battery_power) * 10 }}
{% endif %}
- name: "inverter_system_power"
state_topic: "Sofar2mqtt/state"
unit_of_measurement: "W"
device_class: power
state_class: measurement
value_template: >
{% if value_json.systemIO_power > (65535 / 2) %}
{{ (65535 - value_json.systemIO_power) * 10 }}
{% else %}
{{ -(value_json.systemIO_power) * 10 }}
{% endif %}
- name: "inverter_battery_discharge"
state_topic: "Sofar2mqtt/state"
Expand Down

0 comments on commit f8c7667

Please sign in to comment.