[RELEASE] WaterGuru Pool Integration

This should be considered beta, but it does get information about your pool. It currently requires a python flask app be running on your network to connect to the AWS Lambda endpoint (which requires Cognito + AWS4 auth calls). If you can figure out how to do this in native Hubitat calls, I look forward to the pull requests :slight_smile: It's currently limited to 2 polls per day natively, but you can be creative on how you refresh the data should you need it more often.

This should also be installable via HPM.


(Yes, my pool was out of wack because we were gone for a week).

And notifications via my nodered flow


1 Like

This product looks very interesting and affordable.

And the integration add more value to it. How do you like it?

I’ll tell you in a week or so. I hooked it up long enough to get an account and to capture the API calls then went on vacation; I also had to wait for the square cover adapter. The way I look at it I get daily samples for $50 a pool season (6 months - 3 pack of cartridges is $50 and each lasts 2 months). I can know before lunch if I need to adjust something or go buy something, and if I do need to buy something, I’ll take a sample. I’m hoping flow rate can tell me if the skimmer is full (I.e while on vacation, I can know when to tell the neighbor to come over). A $50/yr cartridge “subscription” is the sweet spot for it to be worth my time/effort to have a gadget give me more visibility into my pool.

The price does look good. Of course they don't ship to Canada.. :frowning:

Honestly, this may be one of those devices that I don't even need to connect. Its good on its own.

Any update on this? Still working? How has it been?

I only had 1 month to run it before we closed the pool, so I can't comment on viability and accuracy. It was pretty close to being accurate in the month we had it. It looks like my integration will still work when I open in April.

@brianwilson

I'm somewhat tech savvy, how hard is this to install, and it's it still working without issue?

If you can start a docker container, it should work withour issue. I don't use this anymore as i get the notifications from their app. I haven't had a use case to need it for tying to other automations, but as you can see apparently I need a reminder to add chlorine.

Hey @brianwilson I have been attempting to follow your thread and duplicate your project. Thus far I have set up a Raspberry Pi to run Docker. (Tested Hello-World, and that was successful). However, I cannot seem to follow your instructions for installing the Dockerfile for Waterguru. Is there something I can do to understand these steps better?
(GitHub - bdwilson/waterguru-api: WaterGuru API)

"Grab the Dockerfile via wget and put it in a directory on your Docker server. Then run the commands below from that directory"

I believe I have grabbed it correctly using wget, but I have not managed to put it any specific directory, any ideas how I do this properly to allow me to get the next steps correct?
It’s currently telling me “Error creating directory /var/docker: Permission denied” if I try to create a directory for it.

Thanks so much for your time, and your contribution to this community!

EDIT: I have managed to change the permissions to allow me to create the directory (using the command: sudo chown -R username:username directory )
then pasted the dockerfile in there. However, upon trying to run the code:

docker build -t waterguru-api --build-arg WG_USER='emailaddress' --build-arg WG_PASS='your_password' .

It gives me the response:
"unknown flag: --build-arg
see docker help" and has a list of docker commands.

If you have any insight into this issue, I would be very grateful! Thanks Again!

1 Like

I would use sudo to create the directory and give your user access to it:

$ sudo mkdir /var/docker
$ sudo chown pi /var/docker
$ mkdir /var/docker/waterguru-api
$ cd /var/docker/waterguru-api
$ wget https://raw.githubusercontent.com/bdwilson/waterguru-api/master/Dockerfile
$ docker build -t waterguru-api --build-arg WG_USER='emailaddress' --build-arg WG_PASS='your_password' .
  • Make sure that your docker command is all on one line. Often copying/pasting will space it out.
  • Make sure there is a space in between the last argument and the "."
  • Make sure copy/paste actually uses the right single quotes - you can go back on the command and delete the single quotes and re-add them back in just to be sure.

Let us know if that works.

Hey Brian,
Upon following those steps: The second step ($ sudo chown pi /var/docker) I get the following response.

chown; invalid user; 'pi'

Should I be substituting my username for "pi" or is there another way around this?

Thanks.

Yes. I assumed if you were on a raspi your user would be that.

Ah, yes, sorry about that.
OK, I have run all of that code and seems like it was successful, however, I don't seem to have gotten much further.

I followed on from there in your readme instructions (GitHub - bdwilson/waterguru-api: WaterGuru API)

"3. Run your newly created image: # docker run -d --restart unless-stopped -p 53255:53255 --name waterguru-api -t waterguru-api (if you changed the port when you built your image, you should also change it here)

You'll need to get the IP address of your docker host, then navigate to: http://your.ip.address:53255/api/wg - this should show you json output from WaterGuru"

I have followed this but I did not get any response after that line of code, and it doesn't appear to show anything on the webpage you mentioned. (http://myPi's.ip.address:53255/api/wg)

Any idea where to go from here?

What does:

docker logs -f waterguru-api 

Say?

It says "Error response from daemon: No such container: waterguru-api"

Which seems interesting to me as the folder /var/docker/waterguru-api/ seems to exist, and shows up in File Manager.

It means your run command didn’t work.

Brian, you are Amazing!! I ran that part of the code again and it seems to have been successful! OK, hopefully this will be the last question for you:

I have installed and set up the integration app you created for hubitat, I see there is a "Set Consumable Status" do you set that to zero when you replace the cartridge? Or is there another purpose for that?

Thanks again man!

1 Like

Thanks for this automation/integration! Just tried to install this, got through most of the details, running it on a Mac in a docker container:

I am getting the following in the logs: File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 960, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.UserNotFoundException: An error occurred (UserNotFoundException) when calling the InitiateAuth operation: User does not exist.

Any advice? Thanks!

I’m guessing your username is wrong? Did you do the single quotes around it? Sometimes copying and pasting single quotes doesn’t translate well so remove them and retype the single quotes.

1 Like

Removing the quotes sorted it out, thanks!

1 Like