From d92916daa23f7bab68246b93053312bc9babc4a3 Mon Sep 17 00:00:00 2001 From: "firstof9@gmail.com" Date: Fri, 28 Jul 2023 15:54:28 -0700 Subject: [PATCH] get sensor states --- custom_components/openevse/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/openevse/__init__.py b/custom_components/openevse/__init__.py index daf0d90..b418c35 100644 --- a/custom_components/openevse/__init__.py +++ b/custom_components/openevse/__init__.py @@ -54,8 +54,8 @@ def handle_state_change( manager = hass.data[DOMAIN][config_entry.entry_id][MANAGER] grid_sensor = config_entry.data.get(CONF_GRID) solar_sensor = config_entry.data.get(CONF_SOLAR) - grid = round(hass.states.get(grid_sensor)) - solar = round(hass.states.get(solar_sensor)) + grid = round(hass.states.get(grid_sensor).state) + solar = round(hass.states.get(solar_sensor).state) invert = config_entry.data.get(CONF_INVERT) if changed_entity in [grid_sensor, solar_sensor]: