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"

Hey, I’m new to the forum and need your help on the following topic: since a couple of weeks we’ve got a Solarwatt system installed and right now we’re trying to integrate it into Home Assistant. As recommended we’re using REST … here’s our config file:

rest:
    # solar power produced
  - resource: http://solar-energiemanager.fritz.box/rest/items/pvplant_standard_0dc3199788a7_harmonized_power_out
    scan_interval: 60
    sensor:
      - name: "SolarWatt Leistung Erzeugung"
        unique_id: "solarwatt.powerplant.power.out"
        icon: mdi:solar-power-variant-outline
        state_class: measurement
        unit_of_measurement: "W"
        device_class: power
        value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float | round(1) }}'
        
    # solar power self consumed
  - resource: http://solar-energiemanager.fritz.box/rest/items/kiwigrid_location_standard_6ce51aeb70e1_harmonized_power_self_consumed
    scan_interval: 60
    sensor:
      - name: "SolarWatt Leistung Eigenverbrauch"
        unique_id: "solarwatt.powerplant.power.selfconsumed"
        icon: mdi:home-lightning-bolt-outline
        state_class: measurement
        unit_of_measurement: "W"
        device_class: power
        value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float | round(1) }}'        
        
    # solar power self supplied
  - resource: http://solar-energiemanager.fritz.box/rest/items/kiwigrid_location_standard_6ce51aeb70e1_harmonized_power_self_supplied
    scan_interval: 60
    sensor:
      - name: "SolarWatt Leistung Einspeisung"
        unique_id: "solarwatt.powerplant.power.selfsupplied"
        icon: mdi:transmission-tower-import
        state_class: measurement
        unit_of_measurement: "W"
        device_class: power
        value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float | round(1) }}'        
        
    # power consumed
  - resource: http://solar-energiemanager.fritz.box/rest/items/kiwigrid_location_standard_6ce51aeb70e1_harmonized_power_consumed
    scan_interval: 60
    sensor:
      - name: "SolarWatt Leistung Gesamtverbrauch"
        unique_id: "solarwatt.power.consumed"
        icon: mdi:home-lightning-bolt-outline
        state_class: measurement
        unit_of_measurement: "W"
        device_class: power
        value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float | round(1) }}'

    # power provided by power station
  - resource: http://solar-energiemanager.fritz.box/rest/items/solarwattBattery_batteryflex_BatteryFlex_0C3512_harmonized_net_power
    scan_interval: 60
    sensor:
      - name: "SolarWatt Verbrauch Netz"
        unique_id: "solarwatt.power.net.consumed"
        icon: mdi:transmission-tower-export
        state_class: measurement
        unit_of_measurement: "W"
        device_class: power
        value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float | round(1) }}'
    
    # battery state of charge
  - resource: http://solar-energiemanager.fritz.box/rest/items/solarwattBattery_batteryflex_BatteryFlex_0C3512_batteryChannelGroup_batteryStateOfCharge
    scan_interval: 60
    sensor:
      - name: "SolarWatt Batterie Ladezustand"
        unique_id: "solarwatt.battery.state.charge"
        icon: mdi:home-battery-outline
        state_class: measurement
        unit_of_measurement: "%"
        device_class: battery
        value_template: '{{ value_json.state }}'
        
    # power consumed from battery
  - resource: http://solar-energiemanager.fritz.box/rest/items/solarwattBattery_batteryflex_BatteryFlex_0C3512_harmonized_bat_power_out
    scan_interval: 60
    sensor:
      - name: "SolarWatt Batterie Verbrauchsleistung"
        unique_id: "solarwatt.battery.power.provided"
        icon: mdi:battery-arrow-down-outline
        state_class: measurement
        unit_of_measurement: "W"
        device_class: power
        value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float | round(1) }}'
        
    # power consumed from battery
  - resource: http://solar-energiemanager.fritz.box/rest/items/solarwattBattery_batteryflex_BatteryFlex_0C3512_harmonized_bat_power_in
    scan_interval: 60
    sensor:
      - name: "SolarWatt Batterie Ladeleistung"
        unique_id: "solarwatt.battery.power.loaded"
        icon: mdi:battery-arrow-up-outline
        state_class: measurement
        unit_of_measurement: "W"
        device_class: power
        value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float | round(1) }}'

    # power consumed by wallbox        
  - resource: http://solar-energiemanager.fritz.box/rest/items/alfensingle_wallbox_7e3cafd5ab59_harmonized_power
    scan_interval: 60
    sensor:
      - name: "SolarWatt Wallbox Verbrauch"
        unique_id: "solarwatt.wallbox.power.consumed"
        icon: mdi:ev-station
        state_class: measurement
        unit_of_measurement: "W"
        device_class: power
        value_template: '{{ value_json.state.split("|")[1]| trim(" W")| float | round(1) }}'

It would be very helpful if anyone out there could confirm, that we interprete the individual fields correclty … they are really hard to understand.

Thanks for your help

Hi again, does anyone have any advice/hint/… whether the assumption made in my previous post related to the interpretation of the REST API of Solarwatt are correct?

Any help would be highly appreciated.