p0l0 / hagruenbeck_cloud

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

Add support for SE Series #117

Open vltnm opened 2 months ago

vltnm commented 2 months ago

System Health details

System Information

version core-2024.8.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.46-haos
arch x86_64
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 4994 Installed Version | 2.0.1 Stage | running Available Repositories | 1468 Downloaded Repositories | 30
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 13.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.08.0 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 30.8 GB disk_used | 26.1 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | kvm board | ova supervisor_api | ok version_api | ok installed_addons | Z-Wave JS (0.6.2), Samba share (12.3.2), Terminal & SSH (9.14.0), Grafana (10.0.0), InfluxDB (5.0.0), File editor (5.8.0), ESPHome (2024.8.3), MQTT Explorer (browser-1.0.1), evcc (0.130.7), Whisper (2.1.2), Piper (1.5.2), openWakeWord (1.10.0), Music Assistant Server (2.2.2)
Dashboards dashboards | 17 -- | -- resources | 19 views | 19 mode | storage
Recorder oldest_recorder_run | 11. August 2024 um 09:56 -- | -- current_recorder_run | 5. September 2024 um 17:05 estimated_db_size | 2187.41 MiB database_engine | sqlite database_version | 3.45.3

Checklist

Describe the issue

Got new Grünbeck SE21. Connected it to the cloud and it is possible manage it via app. Integration does not find any devices in my account.

Reproduction steps

  1. Add integration
  2. fill in account details
  3. click procced

Debug logs

2024-09-06 08:16:05.886 DEBUG (MainThread) [custom_components.gruenbeck_cloud.config_flow] Got 0 Devices

Diagnostics dump

No response

moerpel commented 1 month ago

Same for me having an SE18. 2024-09-25 08:34:17.256 DEBUG (MainThread) [custom_components.gruenbeck_cloud.config_flow] Got 0 Devices The device is available in the app.

moerpel commented 1 month ago

The situation has not changed in 1.0.0. pre-release.

p0l0 commented 1 month ago

I'm still investigating this, it's not fixed yet.

p0l0 commented 1 month ago

@vltnm or @moerpel do you have the possibility to execute the example.py from the pygruenbeck_cloud library, and send me the response for the https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices?api-version=2020-08-03 request?

Before executing, you need to put you login data in line 30 and 31 and install the pygruenbeck_cloud library (pip install pygruenbeck_cloud)

It should look like this:

[03/Oct/2024 19:28:47] DEBUG [__main__._http_request:929] Response from URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices?api-version=2020-08-03 with status 200 was [{'type': 18, 'hasError': False, 'id': 'softliQ.D/ED14672572', 'series': 'softliQ.D', 'serialNumber': 'ED14672572', 'name': 'softIQ:SD18', 'register': True}]
vltnm commented 1 month ago

Output: [04/Oct/2024 09:16:37] DEBUG [__main__._http_request:915] Requesting URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices?api-version=2020-08-03 with method GET [04/Oct/2024 09:16:40] DEBUG [__main__._http_request:929] Response from URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices?api-version=2020-08-03 with status 200 was [] [04/Oct/2024 09:16:40] WARNING [__main__.init:37] No devices found!

p0l0 commented 1 month ago

@vltnm can you try the version from the _next_ branch? Seems like Grünbeck has a new api-version, where SE Models should be supported.

You must install the package version from the branch, so the install command for the package is pip install https://github.com/p0l0/pygruenbeck_cloud/tree/next

vltnm commented 1 month ago

It's working

p0l0 commented 1 month ago

Great! Can you test version 1.0.0b2? It has the newer library version

moerpel commented 1 month ago

Yeah, device is found. Although most of the entities are unavailable. Not sure whether these will be available once they have changed.

vltnm commented 1 month ago

Device found 👍🏻 but all sensors are unknown

moerpel commented 1 month ago

Some more info. Seems like the api delivers the data but the integration does not crunch it properly. Sensitive data like serial number or access token was shortened or deleted.

2024-10-07 08:45:47.882 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Regularly updated gruenbeck_cloud data 2024-10-07 08:45:47.883 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Requesting URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/BS110/?api-version=2024-05-02 with method GET 2024-10-07 08:45:48.170 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Response from URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/BS110/?api-version=2024-05-02 with status 200 was {'errors': [], 'timeZone': '+00:00', 'regMode': 0, 'estatus': 0, 'regTrig': '0', 'startUp': '2024.09.24', 'swVersion': '0004.0010', 'hwVersionCl': '00000006', 'sncu': 'AH2407170150', 'calcRegMo1': '02:00', 'installedOn': '2024-08-14T06:13:52.7202012', 'regMo1': '2024-10-07T02:00:00', 'type': 118, 'hasError': False, 'isRegistered': True, 'id': 'softliQ.SE/BS110', 'series': 'softliQ.SE', 'serialNumber': 'BS110', 'name': 'Weichei', 'register': False} 2024-10-07 08:45:48.173 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Requesting URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/BS110/parameters?api-version=2024-05-02 with method GET 2024-10-07 08:45:48.221 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Response from URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/BS11/parameters?api-version=2024-05-02 with status 200 was {'$pending': [], 'pallowemail': True, 'pallowpushnotification': True, 'phdist': 24, 'pmaxvolmaxcap': 1.46, 'psetsoft': 6.0, 'pminvolmaxcap': 0.54, 'pwashingout': 4.0, 'pminvolmincap': 0.125, 'pregtu3': '--:--', 'pcurrent': 700, 'pregmo2': '--:--', 'pregwe1': '--:--', 'planguage': 1, 'phcurrent': 300, 'psetcapmo': 20.0, 'ptimezone': '02:00', 'pmaxvolmincap': 0.35, 'pregfr1': '--:--', 'pmaintint': 365, 'pregmo1': '02:00', 'pfreqregvalve': 140, 'pregwe2': '--:--', 'poverload': False, 'phload': 400, 'pdate': '2024.10.07', 'pforcedregdist': 3, 'pmonregmeter': 20.0, 'pmonsalting': 75.0, 'pregtu2': '--:--', 'pregwe3': '--:--', 'pregsa1': '--:--', 'pbuzzer': False, 'ppratesoftwater': 0.0043, 'pregsu1': '--:--', 'pregth1': '--:--', 'pregtu1': '--:--', 'pinspect': 180, 'pmondisinf': True, 'pdstdby': True, 'pmode': 2, 'pregmode': False, 'pclearcntreg': False, 'purlcloud1': 'gruenbeckeu01.azure-devices.net', 'phunit': False, 'pregsa2': '--:--', 'pled': 8, 'pdlstauto': True, 'prawhard': 17.0, 'purlcloud2': '', 'phwashingout': 5.0, 'phbackwash': 12.0, 'pregsa3': '--:--', 'pregsu3': '--:--', 'pactcurrent': 3, 'pfreqblendvalve': 300, 'pnomflow': 1.8, 'pregsu2': '--:--', 'pmonblend': False, 'pregfr3': '--:--', 'pregmo3': '--:--', 'pbackwash': 9.0, 'purlcert': 'prodeugruenbeckfirmware.blob.core.windows.net/cert', 'pdurcurrent': 600, 'pledbright': 80, 'pload': 1400, 'pregfr2': '--:--', 'pmodedesinf': 1, 'pntpsync': True, 'pprateregwater': 0.0039, 'pfreqregvalve2': 200, 'pprateblending': 0.004, 'pclearerrmem': False, 'pclearcntwater': False, 'pcontinent': 0, 'pmaxdurdisinfect': 4.0, 'pregth3': '--:--', 'prinsing': 9.5, 'pvolhyg': 6.8, 'pregth2': '--:--'} 2024-10-07 08:45:48.223 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Requesting URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/realtime/negotiate with method GET 2024-10-07 08:45:48.225 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Finished fetching gruenbeck_cloud data in 0.342 seconds (success: True) 2024-10-07 08:45:48.225 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh 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 1071, in __async_calculate_state if extra_state_attributes := self.extra_state_attributes: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/gruenbeck_cloud/sensor.py", line 390, in extra_state_attributes return self.entity_description.extra_attr_fn(self.coordinator.data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/gruenbeck_cloud/sensor.py", line 97, in "daily_usage": [daily.to_dict() for daily in device.water] # type: ignore[union-attr] # noqa: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable 2024-10-07 08:45:48.290 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Response from URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/realtime/negotiate with status 200 was {'url': 'https://prod-eu-gruenbeck-signalr.service.signalr.net/client/?hub=gruenbeck', 'accessToken': 'deleted'} 2024-10-07 08:45:48.290 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Requesting URL https://prod-eu-gruenbeck-signalr.service.signalr.net/client/negotiate?hub=gruenbeck with method POST 2024-10-07 08:45:48.412 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Response from URL https://prod-eu-gruenbeck-signalr.service.signalr.net/client/negotiate?hub=gruenbeck with status 200 was {'negotiateVersion': 0, 'connectionId': '_vlaWNk-t4Xjs', 'availableTransports': [{'transport': 'WebSockets', 'transferFormats': ['Text', 'Binary']}, {'transport': 'ServerSentEvents', 'transferFormats': ['Text']}, {'transport': 'LongPolling', 'transferFormats': ['Text', 'Binary']}]} 2024-10-07 08:45:48.541 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Requesting URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/BS110/realtime/enter?api-version=2024-05-02 with method POST 2024-10-07 08:45:48.690 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Response from URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/BS110/realtime/enter?api-version=2024-05-02 with status 200 was {} 2024-10-07 08:45:48.690 ERROR (MainThread) [custom_components.gruenbeck_cloud.coordinator] Response status code for https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/BS110/realtime/enter?api-version=2024-05-02 is 200, we expected one of [<HTTPStatus.ACCEPTED: 202>].

p0l0 commented 1 month ago

Thanks @moerpel. The response object for SE Devices seems to be a little bit different to the old ones.

I will check it and prepare a new version as soon as possible.

p0l0 commented 1 month ago

Can you please test if you now get data with version 1.0.0b3?

moerpel commented 1 month ago

Tested. Unfortunately still unknown. ![Uploading IMG_0291.jpeg…]()

moerpel commented 1 month ago

`2024-10-18 17:22:09.562 DEBUG (MainThread) [custom_components.gruenbeck_cloud.coordinator] Response from URL https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/serialno/realtime/enter?api-version=2024-05-02 with status 200 was {} 2024-10-18 17:22:09.562 ERROR (MainThread) [custom_components.gruenbeck_cloud.coordinator] Response status code for https://prod-eu-gruenbeck-api.azurewebsites.net/api/devices/softliQ.SE/serialno/realtime/enter?api-version=2024-05-02 is 200, we expected one of [<HTTPStatus.ACCEPTED: 202>].‘