Grohe Sense (Ondus)

Hi Kristusen

I have exactly the same issue as you describe. However, it doesn’t matter whether I use Explore or Chrome, the 401- “Unauthorized - The token was not validated by the Identity Provider” is the only response I get.

BR
Frans

I had to renew my token for some unknown reason just now, and the process worked fine for me, so I can confirm the procedure is still valid. Only use the part after ondus://, replacing ondus with https.

To be sure: you are using the developer tools in google chrome? Without this, you will not be able to see the returned json.

1 Like

Thank you Erik. Your answer made me continue to work on the problem. I studied the links further in the developer tools. It is important to click on the Network tab and then copy the link I have marked with the red arrow. I used the link shown in the buttom of the picture, hence my problems getting the integration to work.

This all looks good - but it’s all using the Grohe cloud, right?

Does anyone know if it’s possible to interact with the device directly - over the local network?

Is this project dead? This link does not work anymore?

https://www.home-assistant.io/integrations/grohe_sense/

This is the link: https://github.com/gkreitz/homeassistant-grohe_sense

Still works perfectly here. Just fetched a new refresh_token. I am very happy for this work from gkreitz! Makes the water stopper exactly as I want it (exept for cloud dependency).

1 Like

Yes, most of it worked for me too. Thanks @gkreitz for this integration. However, my valve switch doesn’t seem to do anything. The switch quickly goes back to the previous position without changing the physical state of the water valve. The sensors on the other hand are all reporting.

On a slightly different note: Wouldn’t it be great to change the state of the ‘Garden sprinkler mode’ with HA? Then it could be switched on every time the sprinkler system is in use. I am not able to do the changes myself but maybe someone who knows a lot more then me in this regard finds some merit in this. Just putting it out there.

The switch is not working in 0.109. It is confirmed working in 0.108. I have posted a github issue about it. I really hope it can be fixed.

From 0.109 on this integration crashes the web UI. So it is now not usable at all. Are you able to look into it, @gkreitz ? It would be highly appreciated!

@Maker2000 Do you have any debug logs from when the valve no longer works? Debug logging can be enabled by something like this in your configuration.yaml:

logger:
  default: error
  logs:
    custom_components.grohe_sense.sensor: debug

I like the idea with garden sprinkler mode. If I remember correctly, the configuration is a bit weird, with a configruation for when to enable sprinkler mode. So it’s likely possible to make a function to turn on/off garden sprinkler mode (setting it on 24/7, or setting it to never), but that does feel a bit scary as if you have any sort of bug leaving it on, you have no flooding protection.

@erikkt Thanks for pinging. My guess (as I mentioned in the github issue just now) is that this is a symptom of an expired refresh token (and of course my code being buggy in handling that). So I’d first test updating the refresh token. If that does not fix the problem, I’d love some debug logging.

@LordMike Yes, this is using the Grohe cloud. Running a port scanner, I don’t see the device listening to any common TCP ports, so with current firmware, there is no obvious way to interact with the device directly.

Thanks for replying! Nothing in logs, I have on

logger:
  default: info
  logs:
    custom_components.grohe_sense.sensor: debug

But the only thing in the log is:

2020-05-22 13:09:12 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for grohe_sense which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-05-22 13:09:14 INFO (MainThread) [homeassistant.setup] Setting up grohe_sense
2020-05-22 13:09:24 WARNING (MainThread) [homeassistant.setup] Setup of grohe_sense is taking over 10 seconds.

My first suspicion was expired refresh_token, so I renewed it first thing without success, but I can do it once more, to be sure.

Dangit, you were right! Fetched a new refresh_token, and it started up again. Unfortunately the most important bit still does not work, the switch. It seemes to show the correct value (controlling it via Grohe app), but it is not possible to control it via HA.
Everything else seems to work though, and that is nice!

Thanks for your reply. I did the debug logger and I only got the following after I refreshed the token (system didn’t work anymore following HA update):


SwitchDevice is deprecated, modify GroheSenseGuardValve to extend SwitchEntity
6:29:34 PM – Switch (WARNING)

Logger: homeassistant.components.switch
Source: components/switch/init.py:125
Integration: Switch (documentation, issues)
First occurred: 6:29:34 PM (1 occurrences)
Last logged: 6:29:34 PM


Not sure if that is of any help. Switch still doesn’t work.

You are right about the sprinkler mode - very risky. But I guess that’s always the case when you use it, also through the Grohe system.

@Maker2000 @erikkt Thanks for reporting these bugs and providing logs. I’ve patched the code so that it should no longer hang everything when starting with a stale refresh token, and the switch should be working again (at least it did for me).

It works perfectly now!
Thanks a lot, man! I can’t tell you how much I appreciate this!

1 Like

Yes, the switch is working on my system now too. Thank you for putting all the work into it!

1 Like

@gkreitz
How long will the token live? Do you need to refresh it frequently?

@jacha It’s a server side configuration, so Grohe can change it at any time, but the last one I got was valid for 180 days. If you’re curious, in the json token you download there is a field called refresh_expires_in which gives the expiry time in seconds (so, 15552000 for 180 days).