p0l0 / hagruenbeck_cloud

Home Assistant integration for Grünbeck Cloud based Water softeners
MIT License
42 stars 1 forks source link

Supporting the new HACS 2.0 platform? #118

Open blue-bean opened 2 months ago

blue-bean commented 2 months ago

Checklist

Is your feature request related to a problem? Please describe.

The new HACS 2.0 comes without support of the sensor platform. Using the Grünbeck integration needs sensor definitions in YAML - so the question is if we could upgrade to HACS 2.0 without losing the sensors?

Describe the solution you'd like

No need to define sensors in YAML?

Describe alternatives you've considered

-

Additional context

-

MonsterEnergy-wtf commented 1 month ago

It seems that hacs 2.0 is breaking the integration. At least from my side I'm missing some sensors. Maybe I find the time this weekend to understabd how the integration is working and what needs to be adjusted.I will update my progress here.

But please no pressure on me ;-)

p0l0 commented 1 month ago

I have vacation for the next 2 weeks, so I will try to have a look on it.

MonsterEnergy-wtf commented 1 month ago

It seems also that somehow the code is not working anymore properly. I can see a lot of errors in the HA logs section related to sensors. I guess this is part of the core problem.

MonsterEnergy-wtf commented 1 week ago

Hi @p0l0 , I checked out the files from the PR https://github.com/p0l0/hagruenbeck_cloud/pull/134 but I still got many "unknowns". Is this intended? As you wanted to merge the code into main, I'm not sure how to test it properly. Any suggestions?

Best regards, Martin

SoftliQSD18

p0l0 commented 1 week ago

Hi @p0l0 ,

I checked out the files from the PR https://github.com/p0l0/hagruenbeck_cloud/pull/134 but I still got many "unknowns".

Is this intended? As you wanted to merge the code into main, I'm not sure how to test it properly.

Any suggestions?

Best regards,

Martin

SoftliQSD18

The latest HACS Release, 1.0.0b1 is already using the changes from PR #134.

I didn't merge it, because I'm still working on the support for SE Series, which has some different response values as SD Series.

Can you please send me the integration diagnostics? With this logs, I will be able to find out why you are not getting values for your sensors.

For me the integration is working without problems for a SD18 Model with HACS 2.0 and Homeassistant 2024.10.4

MonsterEnergy-wtf commented 1 week ago

All right. As I was doing some manual stuff in the configs, I redownloaded 1.0.0b1 again and rebooted HA. After 5 minutes there are some values, but others still missed:

Honestly I don't care as there are several sensors included which are not provided by my SD18. But I need the "nächste Wartung"...

Interestingly the value itself seems to be there. See last screenshot.

My log shows the following:

Logger: homeassistant Source: custom_components/gruenbeck_cloud/select.py:73 integration: Grünbeck Cloud (documentation, issues) First occurred: 14:00:39 (1 occurrences) Last logged: 14:00:39

Error doing job: Task exception was never retrieved (None) Traceback (most recent call last): File "/config/custom_components/gruenbeck_cloud/coordinator.py", line 83, in listen await self.api.listen(callback=self.async_set_updated_data) File "/usr/local/lib/python3.12/site-packages/pygruenbeck_cloud/pygruenbeck_cloud.py", line 1048, in listen callback(device) File "/config/custom_components/gruenbeck_cloud/coordinator.py", line 181, in async_set_updated_data self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 533, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state self.async_calculate_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 145, in state current_option = self.current_option ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/gruenbeck_cloud/select.py", line 245, in current_option return self.entity_description.value_fn(self.coordinator.data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/gruenbeck_cloud/select.py", line 73, in value_fn=lambda device: PARAMETER_OPERATION_MODES[device.parameters.mode], # type: ignore[index] # noqa: E501


KeyError: 5

![2024 11 04 -1](https://github.com/user-attachments/assets/1d7cff22-e96f-4ba7-b03b-daa28b8ad6ab)
![2024 11 04 -2](https://github.com/user-attachments/assets/d616497f-735f-4243-b78b-19b08ce023dd)
![NextMaintainance](https://github.com/user-attachments/assets/612ff95b-a873-4190-9b26-6ce162d8a3ae)
MonsterEnergy-wtf commented 1 week ago

Finally resolved by removing the whole integration and reinstalled via HACS: Now everything seems to work. Sorry for the confusion.

I guess this issue can be closed as well.

Ps. Great work. Thanks!