I have successfully integrated by using the Modbus API, which seems to work quite well.
I think that modbus is better than REST, because the data is transferred in binary, which should be a lot more efficient than getting every single value with JSON…
You should adjust the IP-Address, the Names and the Update/Scan intervals to your needs.
You can also download the protocol table for your specific Installation in your “Anlagenprofil”.
Also the list is not complete, and I do not know what some registers actually do, and some might be labeled incorrectly, so check if the data matches with the FEMS Online Portal first, before using it.
https://docs.fenecon.de/de/_/latest/fems/fems-app/includes/FEMS_App_Modbus_TCP.html
- name: "fems"
close_comm_on_error: false
delay: 5
timeout: 5
type: tcp
host: 192.168.xx.xx
port: 502
sensors:
#INT
- name: "FEMS_EssSoc" # Battery SoC
scan_interval: 60
data_type: uint16
input_type: input
device_class: battery
state_class: measurement
unit_of_measurement: "%"
address: 302
slave: 1
unique_id: fems_modbus_302
#FLOAT32
- name: "FEMS_EssActivePower" # Combined Power of PV + Battery
unit_of_measurement: W
scan_interval: 10
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 303
slave: 1
unique_id: fems_modbus_303
- name: "FEMS_GridActivePower" # Grid Power
unit_of_measurement: W
scan_interval: 10
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 315
slave: 1
unique_id: fems_modbus_315
- name: "FEMS_ProductionDcActualPower" # PV Power
unit_of_measurement: W
scan_interval: 10
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 339
slave: 1
unique_id: fems_modbus_339
- name: "FEMS_ConsumptionActivePower" #House Power
unit_of_measurement: W
scan_interval: 10
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 343
slave: 1
unique_id: fems_modbus_343
- name: "FEMS_EssActivePowerL1"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 391
slave: 1
unique_id: fems_modbus_391
- name: "FEMS_EssActivePowerL2"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 393
slave: 1
unique_id: fems_modbus_393
- name: "FEMS_EssActivePowerL3"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 395
slave: 1
unique_id: fems_modbus_395
- name: "FEMS_GridActivePowerL1"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 397
slave: 1
unique_id: fems_modbus_397
- name: "FEMS_GridActivePowerL2"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 399
slave: 1
unique_id: fems_modbus_399
- name: "FEMS_GridActivePowerL3"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 401
slave: 1
unique_id: fems_modbus_401
- name: "FEMS_ConsumptionActivePowerL1"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 409
slave: 1
unique_id: fems_modbus_409
- name: "FEMS_ConsumptionActivePowerL2"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 411
slave: 1
unique_id: fems_modbus_411
- name: "FEMS_ConsumptionActivePowerL3"
unit_of_measurement: W
scan_interval: 20
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 413
slave: 1
unique_id: fems_modbus_413
- name: "FEMS_EssDischargePower" #Battery Discharge Power
unit_of_measurement: W
scan_interval: 5
data_type: float32
input_type: holding
device_class: power
state_class: measurement
address: 415
slave: 1
unique_id: fems_modbus_415
#Energy (Float64)
- name: "FEMS_EssActiveChargeEnergy" #not sure what this is, I think its the Energy the battery has been charged form AC/the Grid, should not be too high, because its normally not possible/allowed (in Germany at least) to charge from the Grid.
unit_of_measurement: Wh
scan_interval: 60
data_type: float64
input_type: holding
device_class: energy
state_class: total_increasing
address: 351
slave: 1
unique_id: fems_modbus_351
- name: "FEMS_EssActiveDischargeEnergy" #not sure what this is, I think its the total amount of Energy the System has put out to AC, so basicially the the amount of PV minus what is currently stored in the battery plus the amount that you have charged from the Grid (so FEMS_EssActiveChargeEnergy), but that is normally not possible, so this is not very useful.
unit_of_measurement: Wh
scan_interval: 60
data_type: float64
input_type: holding
device_class: energy
state_class: total_increasing
address: 355
slave: 1
unique_id: fems_modbus_355
- name: "FEMS_GridBuyActiveEnergy" #Total Consumption from Grid
unit_of_measurement: Wh
scan_interval: 60
data_type: float64
input_type: holding
device_class: energy
state_class: total_increasing
address: 359
slave: 1
unique_id: fems_modbus_359
- name: "FEMS_GridSellActiveEnergy" #Total Energy Sold to Grid
unit_of_measurement: Wh
scan_interval: 60
data_type: float64
input_type: holding
device_class: energy
state_class: total_increasing
address: 363
slave: 1
unique_id: fems_modbus_363
- name: "FEMS_ProductionActiveEnergy" # Total PV Production Energy
unit_of_measurement: Wh
scan_interval: 60
data_type: float64
input_type: holding
device_class: energy
state_class: total_increasing
address: 367
slave: 1
unique_id: fems_modbus_367
- name: "FEMS_ConsumptionActiveEnergy" # Total Energy Usage
unit_of_measurement: Wh
scan_interval: 60
data_type: float64
input_type: holding
device_class: energy
state_class: total_increasing
address: 379
slave: 1
unique_id: fems_modbus_379
- name: "FEMS_EssDcChargeEnergy" # Total Battery Charge Energy
unit_of_measurement: Wh
scan_interval: 60
data_type: float64
input_type: holding
device_class: energy
state_class: total_increasing
address: 383
slave: 1
unique_id: fems_modbus_383
- name: "FEMS_EssDcDischargeEnergy" # Total Battery Discharge Energy
unit_of_measurement: Wh
scan_interval: 60
data_type: float64
input_type: holding
device_class: energy
state_class: total_increasing
address: 387
slave: 1
unique_id: fems_modbus_387
To integrate it follow these instructions: (by @Skeletitor)
- ssh to /config/ and add to
configuration.yaml
or use the File Editor Addon
modbus: !include modbus.yaml
- create a file
modbus.yaml
(in the same directory asconfiguration.yaml
and paste the upper code for the rest integration. Attention! Adjust the IP of your Fenecon installation. Also you should adjust the channels and the names to those that are interesting to you. - restart Home Assistant