From bbe8645e233eec150ef8d5bb79d13adae22b7fd9 Mon Sep 17 00:00:00 2001 From: dphroon <77174861+dphroon@users.noreply.github.com> Date: Sun, 5 Sep 2021 19:42:11 +1000 Subject: [PATCH] Update __init__.py Update state_class to new type "total_increasing" and remove last_reset For Home Assistant Energy https://developers.home-assistant.io/blog/2021/08/16/state_class_total/ --- custom_components/sems2mqtt/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/custom_components/sems2mqtt/__init__.py b/custom_components/sems2mqtt/__init__.py index 495047a..9db3a59 100644 --- a/custom_components/sems2mqtt/__init__.py +++ b/custom_components/sems2mqtt/__init__.py @@ -244,9 +244,7 @@ def create_device(model): 'value_template':'{{ value_json.etotal_kwh }}', 'icon':'mdi:flash', 'state_topic':'sems/sensors', - 'state_class': "measurement", - 'last_reset_value_template':'1970-01-01T00:00:00+00:00', - 'last_reset_topic':'sems/sensors', + 'state_class': "total_increasing", 'device_class': 'energy', 'unique_id':'sems_produced_total_sensor', 'device': create_device(data['type'])