diff --git a/apps/pv_opt/pv_opt.py b/apps/pv_opt/pv_opt.py index 994c896..57daece 100644 --- a/apps/pv_opt/pv_opt.py +++ b/apps/pv_opt/pv_opt.py @@ -1566,11 +1566,11 @@ def _expose_configs(self, over_write=True): ) def status(self, status): - entity_id = f"sensor.{self.prefix.lower()}status" + entity_id = f"sensor.{self.prefix.lower()}_status" attributes = {"last_updated": pd.Timestamp.now().strftime(DATE_TIME_FORMAT_LONG)} - self.log(f">>> {status}") - self.log(f">>> {entity_id}") - self.log(f">>> {self.set_state(state=status, entity_id=entity_id, attributes=attributes)}") + # self.log(f">>> {status}") + # self.log(f">>> {entity_id}") + self.set_state(state=status, entity_id=entity_id, attributes=attributes) @ad.app_lock def optimise_state_change(self, entity_id, attribute, old, new, kwargs): diff --git a/apps/pv_opt/solis.py b/apps/pv_opt/solis.py index 154ed6f..a436fcd 100644 --- a/apps/pv_opt/solis.py +++ b/apps/pv_opt/solis.py @@ -323,6 +323,8 @@ def inverter_details(self): if response.status_code == HTTPStatus.OK: return response.json()["data"] + else: + return {"state": 0} @property def is_online(self):