LavermanJJ / home-assistant-solarfocus

🏡 Solarfocus eco manager touch integration for Home Assistant
Apache License 2.0
17 stars 7 forks source link

v2.2.2 does not update the readings. Question #45

Closed Vaszago closed 1 year ago

Vaszago commented 1 year ago

I upgraded to V2.2.2 yesterday. But in this version, the measured values are no longer updated. If I switch back to V2.2.0 they will be updated again. Do I have to slightly delete and reinstall the integration to get it working. Do I lose the recordings in Grafana.

PhilippRettenmeier commented 1 year ago

Same for me, since v2.2.2 no updates of values in Home Assistant. Only possibility is to reload manually the device.

Modbus values from Solurfocus software are updated regularly, using Solarfocus Software 22.010 for my vamp.air

LavermanJJ commented 1 year ago

Thanks for reporting. I'll have a look.

LavermanJJ commented 1 year ago

@Vaszago did you only check your HA dashboard, or also on the device section in the settings? Usually, I'd say that if the entities on your dashboard are not grayed out, they should be updated by the integration.

@Vaszago @PhilippRettenmeier are there any logs / error messages from solarfocus integration? The only changes from v2.2.0 to 2.2.2 were regarding the translation keys. In my setup, I did not have to re-install the integration.

@Vaszago I'd assume, you will not loose the recordings in the database you use for Grafana. However, it could be that the entities get renamed (depending on when you last installed the integration). However, Grafana allows to combine multiple entities within one graph, so you could still show them as "one" in Grafana. Or you could even migrate the values in the database, if you feel like it.

PhilippRettenmeier commented 1 year ago

Thanks @LavermanJJ for the reply.

I couldn't find any errors in my logfile for the solarfocus integration. As mentioned by @Vaszago, when downgrading to v2.2.0, the values for the Solarfocus entities are updated again... Upgrading to v2.2.2, and the values are not updated again. Since I am using the values e. g. for Thermal Power to update config sensors (manually calculating the COP & "Arbeitszahl"), I will wait for the next version of the integrations ;)

Ah, by the way, I was looking the the HA setting > Devices > Solarfocus to look up the updating process of the entity values...

Here the image of two of the entities: Using v2.2.2 until approx. 16:00, then downgrading to v2.2.0 (heat pump was running at approx. 18:00 and then updating the values correcly, but was also runnig e. g. at 12:00). At approx 13:00, I was re-loading the integration manually...

image

image

LavermanJJ commented 1 year ago

@PhilippRettenmeier thanks for providing more insights. TBH I have no clue at the moment, why that is happening. As this is a "local_polling" integration, HA regularly triggers the integration to reload the values. Why this is not happening is unclear to me. If it is fine for you, I'd invest my time in finalizing v3.0.0. and not debugging further.

If you want do dig deeper into it, you could activate the debug logs for the integration and check if there are either one of the logs statements: https://github.com/LavermanJJ/home-assistant-solarfocus/blob/6140137d6f7c6da526efae0d66493185594d042c/custom_components/solarfocus/coordinator.py#L97-L100

that would indicate whether or not HA is requesting the integration to update. To set the logger see https://www.home-assistant.io/integrations/logger/ should be something like

# Example configuration.yaml entry
logger:
  default: info
  logs:
    custom_components.solarfocus: debug
PhilippRettenmeier commented 1 year ago

Fine for me since v2.2.0 is working fine, thanks @LavermanJJ - great job so far!

Vaszago commented 1 year ago

I am now 21 days on KUR. Can't test at the moment.

saschaguilliard commented 1 year ago

I have the same Problem. Maybe I can help a little bit. I have a Therminator with 22.021 and 3.0.0-beta4

image Modbus TCP send Messages every 30 seconds. Refreshtime setup is 50 seconds image Refresh in HA is just after a reboot. image

Here the last LOG: 2023-05-04 18:45:46.222 ERROR (MainThread) [homeassistant.helpers.entity] Update for select.solarfocus_heating_circuit_1_cooling fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 554, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update await coro File "/config/custom_components/solarfocus/entity.py", line 128, in async_update await self.coordinator.async_request_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 211, in async_request_refresh await self._debounced_refresh.async_call() File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 95, in async_call await task File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 237, in async_refresh await self._async_refresh(log_failures=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 349, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 146, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 649, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 591, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 561, in state raise ValueError( ValueError: Sensor sensor.solarfocus_boiler_1_mode provides state value '3', which is not in the list of options provided

lein1013 commented 1 year ago

in 3.0.0-beta4 the mode range is wrong - but already fixed in the current latest main branch grafik

temporary you can edit this value in Home Assistant using Studio Code Server Addon and edit custom_components/solarfocus/sensor.py and change 3 to 5

LavermanJJ commented 1 year ago

@saschaguilliard Thanks for providing additional logs 👍

I'll create a new beta release

LavermanJJ commented 1 year ago

As version 3.0.0 is now finally released, I'll close this issue.