Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed new api #34

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Fixed new api #34

wants to merge 15 commits into from

Conversation

weissm
Copy link

@weissm weissm commented Sep 23, 2023

Appearently Grohe has changed its Api.
Took the changes discussed here as basis:
FlorianSW/grohe-ondus-api-java#14

@svalavuo
Copy link

svalavuo commented Oct 5, 2023

I made all the changes to files, but I still can't get any values to HA.
HA Log shows:

Logger: homeassistant.helpers.entity
Source: custom_components/grohe_sense/sensor.py:128
Integration: Grohe Sense ([documentation](https://github.com/gkreitz/homeassistant-grohe_sense))
First occurred: October 4, 2023 at 19:49:30 (1 occurrences)
Last logged: October 4, 2023 at 19:49:30

Update for sensor.minun_guard_flowrate fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 683, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 936, in async_device_update
    await self.async_update()
  File "/config/custom_components/grohe_sense/sensor.py", line 249, in async_update
    await self._reader.async_update()
  File "/config/custom_components/grohe_sense/sensor.py", line 128, in async_update
    w['starttime'] = parse_time(w['starttime'])

What might be the problem?

@weissm
Copy link
Author

weissm commented Oct 6, 2023

I made all the changes to files, but I still can't get any values to HA. HA Log shows:

Logger: homeassistant.helpers.entity
Source: custom_components/grohe_sense/sensor.py:128
Integration: Grohe Sense ([documentation](https://github.com/gkreitz/homeassistant-grohe_sense))
First occurred: October 4, 2023 at 19:49:30 (1 occurrences)
Last logged: October 4, 2023 at 19:49:30

Update for sensor.minun_guard_flowrate fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 683, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 936, in async_device_update
    await self.async_update()
  File "/config/custom_components/grohe_sense/sensor.py", line 249, in async_update
    await self._reader.async_update()
  File "/config/custom_components/grohe_sense/sensor.py", line 128, in async_update
    w['starttime'] = parse_time(w['starttime'])

What might be the problem?

From my understanding, 'starttime' is not provided anymore via the new API. Hence, the associated checking code seems to be void. You may either check for the existance of 'starttime' or remove this if section. Hope, this helps.

@svalavuo
Copy link

svalavuo commented Oct 6, 2023

  File "/config/custom_components/grohe_sense/sensor.py", line 128, in async_update
    w['starttime'] = parse_time(w['starttime'])

What might be the problem?

From my understanding, 'starttime' is not provided anymore via the new API. Hence, the associated checking code seems to be void. You may either check for the existance of 'starttime' or remove this if section. Hope, this helps.

So I should remove everything from line 124 to line 137. Quite big chunk of code...

@svalavuo
Copy link

svalavuo commented Oct 8, 2023

Now it seems to get some data from Grohe. I set HA loglevel to debug, booted my host, and now I can see following in container log:
[custom_components.grohe_sense.sensor] Data read: {'group_by': 'day', 'measurement': [{'date': '2023-10-08', 'flowrate': 0.2, 'pressure': 5.22, 'temperature_guard': 14.62}, ..., 'withdrawals': [{'date': '2023-10-08', 'waterconsumption': 91.3, 'hotwater_share': 9.4, 'water_cost': 0.4, 'energy_cost': 0.04}, ...]}
Should HA (grohe integration) understand that directly? If so, how should those sensors show up in HA?
Sorry to flood this, but I'd like to have that integration working.
Thanks for the fix to API!
This should be merged to main asap.

@weissm
Copy link
Author

weissm commented Oct 9, 2023

This should indeed show up as sensor entity. The name should start with the one you provided in the Grohe App. All data you show are refering to GROHE_SENSE_GUARD_TYPE.

@areeeee
Copy link

areeeee commented Oct 10, 2023

Nice job! I had it fully working a few days :) Suddenly all sensors from the grohe sense guard unit is gone. pressure, flowrate, temperature, 1 day and 7 day. The main valve button is still there and working. Has anything changed or is this a problem on my end?

I am getting a lot of these messages in the logs:
WARNING (MainThread) [homeassistant.components.sensor] Updating grohe_sense sensor took longer than the scheduled update interval 0:00:30

The flood sensors updates humidity and temperatures once every 24 hours.

Another question. I get the notifications in HA for flooding, but no notifications when the flooding is fixed. Is this correct?
I was hoping to make these into binary sensors, but with no reset that's probably no good.

@weissm
Copy link
Author

weissm commented Oct 11, 2023

Please note that the update changed proposed above by FlorianSW is now utilizing a daily update. Hence, at least the 24h update frequency could be understood. Everything else sounds akward, while the warning itself is standard for the sensor having problems starting up. Hope you can fix it.

@svalavuo
Copy link

This should indeed show up as sensor entity. The name should start with the one you provided in the Grohe App. All data you show are refering to GROHE_SENSE_GUARD_TYPE.

For some reason my integration doesn't bring any sensors or entities. :-(
Integration doesn't give errors on start, so it should be ok. I'm quite confused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants