weltmeyer / ha_sonnenbatterie

Homeassistant integration to show many stats of Sonnenbatterie
GNU General Public License v3.0
51 stars 24 forks source link

Internal Max Temp and Charge/Discharge status unavailable #61

Closed cristianriseri closed 3 weeks ago

cristianriseri commented 3 weeks ago

in the last 2 updates my HA is not able to receive Temp and Charga/Discharge status, is it only a problem of my installation or is it an issue? Cattura

this is that I found in the log file

2024-06-10 02:29:54.657 ERROR (MainThread) [custom_components.sonnenbatterie] Traceback (most recent call last): File "/config/custom_components/sonnenbatterie/coordinator.py", line 83, in _async_update_data self.latestData["battery"] = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 142, in get_battery return self._get(SONNEN_API_PATH_BATTERY) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 71, in _get response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: http://192.168.178.51/api/battery

2024-06-10 02:30:04.852 ERROR (MainThread) [custom_components.sonnenbatterie] Traceback (most recent call last): File "/config/custom_components/sonnenbatterie/coordinator.py", line 83, in _async_update_data self.latestData["battery"] = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 142, in get_battery return self._get(SONNEN_API_PATH_BATTERY) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 71, in _get response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: http://192.168.178.51/api/battery

2024-06-10 02:30:14.851 ERROR (MainThread) [custom_components.sonnenbatterie] Traceback (most recent call last): File "/config/custom_components/sonnenbatterie/coordinator.py", line 83, in _async_update_data self.latestData["battery"] = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 142, in get_battery return self._get(SONNEN_API_PATH_BATTERY) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 71, in _get response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: http://192.168.178.51/api/battery

2024-06-10 02:30:24.847 ERROR (MainThread) [custom_components.sonnenbatterie] Traceback (most recent call last): File "/config/custom_components/sonnenbatterie/coordinator.py", line 83, in _async_update_data self.latestData["battery"] = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 142, in get_battery return self._get(SONNEN_API_PATH_BATTERY) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 71, in _get response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: http://192.168.178.51/api/battery

RustyDust commented 3 weeks ago

in the last 2 updates my HA is not able to receive Temp and Charga/Discharge status, is it only a problem of my installation or is it an issue?

What state are you using to display these values? Please go to "Settings -> Devices & Services -> Sonnenbatterie -> Entities" and check that they are still available. If you see a red exclamation mark for some of the entities, those have been renamed to new names. @Xitee1 : Any fast pointers? I'm guessing this is related to sensor.sonnebatterie_<id>_production_input and sensor.sonnebatterie_<id>_production_output which should now be sensor.sonnebatterie_<id>_state_battery_output and sensor.sonnebatterie_<id>_state_battery_input, right?

2024-06-10 02:29:54.657 ERROR (MainThread) [custom_components.sonnenbatterie] Traceback (most recent call last): File "/config/custom_components/sonnenbatterie/coordinator.py", line 83, in _async_update_data self.latestData["battery"] = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 142, in get_battery return self._get(SONNEN_API_PATH_BATTERY) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/sonnenbatterie/sonnenbatterie.py", line 71, in _get response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: http://192.168.178.51/api/battery

This is most likely unrelated to the problem above. The Sonnenbatterie seems to be running some daily maintenance for a couple of minutes early every morning during which time frame the API isn't available. I'm seeing the same here every day.

RustyDust commented 3 weeks ago

Oh, and sensor.sonnebatterie_<id>_battery_system_tmax is now sensor.sonnebatterie_<id>_tmax if I'm not mistaken.

Xitee1 commented 3 weeks ago

Oh, and sensor.sonnebatterie_<id>_battery_system_tmax is now sensor.sonnebatterie_<id>_tmax if I'm not mistaken.

Yes, this has been renamed. You need to enable the new temperature sensor (in the device overview expand the hidden entities) and either rename the entity id back to the old or use the new entity id in your dashboard and other places.

For the battery sensor, I don't remember a battery state sensor being there. Do you mean the in/out battery sensor or was there actually a battery state sensor @RustyDust ?

RustyDust commented 3 weeks ago

@Xitee1 Bildschirmfoto 2024-06-11 um 10 36 10

These are the ones my installation is "missing" after upgrading to the new version.

Xitee1 commented 3 weeks ago

So it looks like there wasn't a battery state sensor. @cristianriseri probably means the battery charge/discharge watts sensor (which should still be there). By default, it should have this entity id: sensor.sonnenbatterie_<id>_state_battery_inout @cristianriseri Can you please check in the device overview if the sensor is somewhere in the list?

cristianriseri commented 3 weeks ago

Hi, thank you for all the messages, I finally found them the Temp has changed name and the Casica/scarica is sensor.sonnenbatterie__state_sonnenbatterie

THANK YOU