From 758113074bc66affc90561720f4b390cd67c18f0 Mon Sep 17 00:00:00 2001 From: johanschelin <65488934+johanschelin@users.noreply.github.com> Date: Sat, 30 Sep 2023 17:18:54 +0200 Subject: [PATCH 1/2] Update sensor.py changed self_state to default 0 to skip errormessage when using riemann sum sensors. --- custom_components/sonnenbatterie/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/sonnenbatterie/sensor.py b/custom_components/sonnenbatterie/sensor.py index 697d6e0..bea15c7 100644 --- a/custom_components/sonnenbatterie/sensor.py +++ b/custom_components/sonnenbatterie/sensor.py @@ -109,7 +109,7 @@ def generateDeviceInfo(configentry_id,systemdata): class SonnenBatterieSensor(CoordinatorEntity,SensorEntity): def __init__(self,id,deviceinfo,coordinator,name=None): self._attributes = {} - self._state = "NOTRUN" + self._state = "0" self._deviceinfo=deviceinfo self.coordinator=coordinator self.entity_id = id From 8ee6df24f90bd014f49e186c67d903cc77e5cd6a Mon Sep 17 00:00:00 2001 From: johanschelin <65488934+johanschelin@users.noreply.github.com> Date: Sat, 30 Sep 2023 17:34:59 +0200 Subject: [PATCH 2/2] Update mappings.py Edited module_count to replace SensorDeviceClass.Battery with None to correct the device showing "almost empty battery", as it reads this entity as Battery% information. --- custom_components/sonnenbatterie/mappings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/sonnenbatterie/mappings.py b/custom_components/sonnenbatterie/mappings.py index e10c612..520ed55 100644 --- a/custom_components/sonnenbatterie/mappings.py +++ b/custom_components/sonnenbatterie/mappings.py @@ -91,8 +91,8 @@ "modules": { "sensor": "module_count", "friendly_name": "Battery module count", - "unit": "", - "class": SensorDeviceClass.BATTERY, + "unit": None, + "class": None, }, }, "inverter": {