TankUtility monitoring (app and device)

It would be good to show full logs in a private message for the tank utility connect.

ie turn on debug and turn on verbose, and done your way out.

I see mine connecting....

1 Like

Sent logs...

Me too….logs sent

1 Like

Hey guys, just got a very gracious email from a Tank Utility engineer who, after I reached out to them a few days ago, had (!!!) purchased a Hubitat hub and then adjusted this code so that it addresses the SSL certificate issue. I tried it and it works for me.

Talk about going above and beyond. Kudos to Tank Utility!!

@nh.schottfam I’ll DM you the edited code — not sure best way to handle the version control with this?

2 Likes

That's way cool.

1 Like

@nh.schottfam coupla things....

  1. per the note two above in this thread, do you want to merge the edited code into your TankUtility code?

  2. I noticed my TankUtility has stopped synching lately -- are others having problems too?

EDIT: @david22 and I are experiencing the same API (see below for logging). I'm going to try to reach out to the Tank Utility guy to see if they changed their API. BRB....

Log

app:17092024-04-09 10:18:12.616 AMwarn| Tank Utility v2 (Connect) | pollChilcren: Was not able to refresh API token expired at 0.

app:17092024-04-09 10:18:12.614 AMwarngetToken false Was not able to refresh API token expired at 0.

app:17092024-04-09 10:18:12.613 AMerrorreturning false getAPIToken Error in the getAPIToken method: groovy.lang.MissingPropertyException: No such property: token for class: java.io.StringReader

I will post a fix, I think they changed their api

1 Like

new version, should be available in HPM

2 Likes

Thanks @nh.schottfam .... but I'm still having problems with the API. Maybe it's just me? Logs follow.

EDIT: Just wondering, do we need to reset the access token?

Logs

pp:17092024-04-09 12:05:45.902 PMwarn| Tank Utility v2 (Connect) | pollChilcren: Was not able to refresh API token expired at 0.
app:17092024-04-09 12:05:45.901 PMwarngetToken false Was not able to refresh API token expired at 0.
app:17092024-04-09 12:05:45.899 PMerrorreturning false getAPIToken Error in the getAPIToken method: groovy.lang.MissingPropertyException: No such property: token for class: java.io.StringReader
app:17092024-04-09 12:05:45.890 PMdebugTank Utility v2 (Connect) | getToken Return Code: 200 Response: {"token":"###TOKEN REDACTED###"}
app:17092024-04-09 12:05:45.355 PMtracegetAPIToken()Requesting an API Token!

Exchanged emails with TankUtility engineer (awesome guy from awesome company) and he confirmed that there was a change to the API, but that the fix should be straightforward, just as @nh.schottfam suggested. Standing by....

I would re-login

I did re-login

I discovered the problem. Perhaps this will help others. When I updated the TankUtility HE app via HPM, it actually created a duplicate app code, rather than replaced the existing one. Not sure why -- could be an EBKAC or an ID10T error. I was therefore unwittingly using the old version of the app :smiling_face:

Deleted the old, reinstalled the app, all is good. Hope my embarrassing experience helps others.

1 Like

I installed with HPM, all went fine. I'm now trying to figure out how I connect it to my TankUtility monitoring account? In other words, where do I enter the device-specific information? I did a curl command to getToken, but not sure where to enter it. Do I also need a Client ID and Client Secret? Or, are those public values that are not specific to my particular unit? Thank you in advance!

Logs:
dev:5192024-04-22 03:22:10.702 PMerrorjava.lang.NullPointerException: Cannot invoke method pollChildren() on null object on line 77 (method refresh)

dev:5192024-04-22 03:22:10.694 PMdebugExecuting 'poll' using parent SmartApp

dev:5192024-04-22 03:22:10.693 PMdebugrefresh called

dev:5192024-04-22 03:18:38.368 PMerrorjava.lang.NullPointerException: Cannot invoke method pollChildren() on null object on line 77 (method poll)

dev:5192024-04-22 03:18:38.333 PMdebugExecuting 'poll' using parent SmartApp

@mluck Could you provide guidance on what to do once I've installed the TankUtility Driver and TankUtility (Connect) app? Thank you.

you should be able to enter your username and password in the connect app and hit done

1 Like

@JDA, I'm not sure how familiar you are with Hubitat, so hard to say where to start, but...
assuming you've installed the app and driver code, and then added the TankUtility user app, then all you do, as @nh.schottfam said, is run the app, follow the instructions to enter your TankUtility name and password, and the app IIRC will automatically create your tank monitoring device. That's it.

One failsafe is to make sure you can monitor your tank using the TankUtility native web interface first. As long as you can do that, you should be good to go with these instructions.

Let us know if you have any problems. Best o' luck.

1 Like

Hi @mluck, thanks so much for your response. Yes, I've been running the TankUtility app on my iOS since 2015, and also the web interface. What I've done so far is pasted in the driver code and the user app code into their respective pages in HE. Thanks to your advice, I executed TankUtility (Connect), entered my credentials, and it said "Authentication Succeeded". I cannot seem to get farther than this (but still farther ahead than before your help. :)) I've seen in the logs: "device installed". I've created a virtual device of type TankUtility, and enabled this on a couple of dashboards. Is that the right next step? When I go to add a tile, I see the device, select it, and none of the templates seem to give me any information. Thanks for any more advice you can give. I come back to hubitat every once in a while, but don't work on it very regularly (so I might be forgetting something basic here). As far as my system so far, I have about 140 devices installed, including lights, dimmers, blinds, fan controllers, sprinkler system, security, valve controls, garage doors, solar panel installation, energy meter (still working on getting this working, able to access from python, not HE yet), etc.

Hey @nh.schottfam, thank you for this. I am not sure whether I had actually executed the code this last time, but @mluck suggested this (now obvious to me but apparently not yesterday...). My problem now is that I created a virtual device (is that the right thing to do) of type TankUtility, and the log says "device installed". I could not figure out how to get a value from it. Then I figured I should be able to connect it to a tile and show it on a dashboard. I see the device in dashboard but cannot find a template to show its value. Any ideas?

You might want to check that the app didn’t already create the device and associate it as part of the app install and config.