Hello there,
I tried to setup a SOC Sensor from json values in MQTT here my config so far.
#Netzeinspeisung
sensor.netzeinspeisung:
state_class: total_increasing
#Gaszähler
sensor.gasmetercount:
state_class: total_increasing
#Batterieladezustand
sensor.state_of_battery:
state_class: measurement
#InBatterie
sensor.AcIn1ToInverter:
state_class: total_increasing
#OutBatterie
sensor.InverterToAcIn1:
state_class: total_increasing
mqtt:
sensor:
- name: "Gaszähler"
unique_id: gasmetercount
device_class: gas
state_topic: "Gasmeter/qubikmeter"
unit_of_measurement: "m³"
- name: "Batterieladezustand"
state_topic: "N/b827eb66f436/system/0/Batteries"
unit_of_measurement: "%"
device_class: battery
unique_id: "state of battery"
value_template: "{{ value_json['value'].soc }}"
- name: "OutBatterie"
state_topic: "N/b827eb66f436/vebus/289/Energy/InverterToAcIn1"
unit_of_measurement: "kWh"
device_class: energy
unique_id: "InverterToAcIn1"
value_template: "{{ value_json['value']|round(3)}}"
- name: "InBatterie"
state_topic: "N/b827eb66f436/vebus/289/Energy/AcIn1ToInverter"
unit_of_measurement: "kWh"
device_class: energy
unique_id: "AcIn1ToInverter"
value_template: "{{ value_json['value']|round(3)}}"
- name: "Netzeinspeisung"
state_topic: "N/b827eb66f436/grid/30/Ac/Energy/Reverse"
unit_of_measurement: "kWh"
device_class: energy
unique_id: "energy total to grid"
value_template: "{{ value_json['value']|int}}"
this is the MQTT topic and its values:
N/b827eb66f436/system/0/Batteries
{"value": [{"voltage": 48.09000015258789, "instance": 512, "id": "com.victronenergy.battery.socketcan_can0", "temperature": 20.899999618530273, "power": 0.0, "state": 0, "name": "Pylontech battery", "active_battery_service": true, "current": 0.0, "soc": 9}]}
no matter what iam doing, the sensor.state_of_battery is not showing up in entities what so ever.
i do not understand why. All other sensors are working fine. Where is the Catch?
Then i tried to integrate sensor.AcIn1ToInverter and sensor.InverterToAcIn1.
but the sensors are not choosable in energy battery Dashboard.
Why? I already set unit_of_measurement, device_class and state_class.
Otherwise this sensors are working fine.