SOLARWATT Manager Flex 1.0

Hello dear community

I use the SOLARWATT system at home for my photovoltaic system, namely the Manager Flex 1.0. Here I would like to be able to connect this system with Home Assistant. The Fronius inverter wasn’t a problem at all, but it would be nice if I could also display the storage (the Battery Flex AC-1 1.3).

Thank you very much.

Hi Frank,

the Solarwatt Energy Manager Flex is basically a OpenHab instance “under the hood”, so it is very easy to integrate in different ways.

One way is to use a custom component like this one:

The second way (which may be easier if you are only interested in a few values) is the REST-API of the Solarwatt Manager.

You can access it by IP.of.your.manager/rest/items

This will give you a JSON with all available items of the Solarwatt Manager (names are a bit cryptic though).

As I have no battery connected to my Solarwatt Manager, I can’t help you with the exact name, but I guess you will easily find it in the JSON looking for words like “storage”, “battery” or “charge”.

Once you found the item, you can call it directly like this (it is one inverters power output):

http://IP.of.your.Manager.flex/rest/items/sunspecnext_inverter_KACO_new_energy_bp_5_0_NX3_M2_5_0NX312012802_inverter_W

which gives you something like

{
"link": "http://192.168.xxx.xxx/rest/items/sunspecnext_inverter_KACO_new_energy_bp_5_0_NX3_M2_5_0NX312012802_inverter_W",
"state": "480 W",
"stateDescription": {
"pattern": "%.2f %unit%",
"readOnly": true,
"options": []
},
"editable": false,
"type": "Number:Power",
"name": "sunspecnext_inverter_KACO_new_energy_bp_5_0_NX3_M2_5_0NX312012802_inverter_W",
"label": "AC Power",
"tags": [],
"groupNames": []
}

Now you can easily parse the state of this item and use it in HA. Hope this helped a bit.

Hey. This is my config for the different readings which may be interesting to you. This should also give a hint how to read the JSON create sensors from it.

Btw i’ve often choosen the string value with the unit included as they were total increasing instead of instant readings which gives more stable values and you can do more calculations based on them. Also you can directly see which unit it is and don’t have to guess.

You will have to adjust the IP address and should also setup a fixed address in your router for the energymanager.

sensor:
  - platform: rest
    resource: http://192.168.178.81/rest/items/solarwattBattery_batteryflex_BatteryFlex_0BF34C_batteryChannelGroup_batteryStateOfCharge
    name: "Battery State of Charge"
    device_class: battery
    unique_id: "pv_batteryStateOfCharge"
    value_template: "{{ float(value_json.state) }}"
    unit_of_measurement: "%"
  - platform: rest
    resource: http://192.168.178.81/rest/items/modbus_sunspec_fronius_inverter_32294399_acGeneral_ac_power
    name: "Wechselrichter AC Power"
    device_class: power
    unique_id: "pv_converter_ac_power"
    value_template: '{{ value_json.state| trim(" W")| float }}'
    unit_of_measurement: "W"
  - platform: rest
    resource: http://192.168.178.81/rest/items/solarwattBattery_batteryflex_BatteryFlex_0BF34C_batteryChannelGroup_batteryEnergyIn
    name: "Battery Energy IN"
    device_class: energy
    unique_id: "pv_battery_energy_in"
    value_template: '{{ value_json.state| trim(" Wh")| float }}'
    unit_of_measurement: "Wh"
    state_class: total_increasing
  - platform: rest
    resource: http://192.168.178.81/rest/items/solarwattBattery_batteryflex_BatteryFlex_0BF34C_batteryChannelGroup_batteryEnergyOut
    name: "Battery Energy OUT"
    device_class: energy
    unique_id: "pv_battery_energy_out"
    value_template: '{{ value_json.state| trim(" Wh")| float }}'
    unit_of_measurement: "Wh"
    state_class: total_increasing
  - platform: rest
    resource: http://192.168.178.81/rest/items/modbus_sunspec_fronius_inverter_32294399_acGeneral_ac_lifetime_energy
    name: "Wechselrichter Energy Total"
    device_class: energy
    unique_id: "pv_energy_total"
    value_template: '{{ value_json.state| trim(" Wh")| float }}'
    unit_of_measurement: "Wh"
    state_class: total_increasing
  - platform: rest
    resource: http://192.168.178.81/rest/items/solarwattBattery_batteryflex_BatteryFlex_0BF34C_harmonized_net_power_out
    name: "Netzeinspeisung"
    device_class: power
    unique_id: "pv_net_power_out"
    value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float }}'
    unit_of_measurement: "W"
  - platform: rest
    resource: http://192.168.178.81/rest/items/solarwattBattery_batteryflex_BatteryFlex_0BF34C_harmonized_net_power_in
    name: "Netzbezug"
    device_class: power
    unique_id: "pv_net_power_in"
    value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float }}'
    unit_of_measurement: "W"