TankUtility monitoring (app and device)

@JDA, I can't say that it won't work if you create a device yourself, but if you're having problems, I'd suggest you start from scratch and just install the app. Once you put in your login and password, and then hit done, the device will automatically be created.

@mluck & @nh.schottfam, thank you again for your help. I am still having the problem of no trace of the device once the TankUtility package is installed and set up. I started all over again, uninstalling from HPM, rebooting hub, confirming that all traces of the app and driver were gone, reinstalling via HPM, setting up with username and password, confirming successful authentication, etc. There is no sign of a device related to TankUtility. This is why the last time I attempted to install the new device. Can you comment on where I might be making the error? Note that this is a 2nd gen TankUtility device (not the newest) and that it is fully accessible via the iOS and web interface. Thank you.

Logs:
app:4052024-04-25 01:02:59.876 PMwarn| Tank Utility (Connect) | pollChilcren: no devices available

app:4052024-04-25 01:02:59.606 PMwarn| Tank Utility (Connect) | RefreshDeviceState: no devices available

app:4052024-04-25 01:02:59.597 PMinfo|| Tank Utility (Connect) | Token refresh Success. Token expires at 1714150979589

app:4052024-04-25 01:02:59.483 PMdebugTank Utility (Connect) | getToken Return Code: 200 Response: {"token":"AMf-vBy54GiF4 ...

app:4052024-04-25 01:02:59.348 PMtracegetAPIToken()Requesting an API Token!

app:4052024-04-25 01:02:59.346 PMtrace| Tank Utility (Connect) | API token expired at 0. Refreshing API Token

app:4052024-04-25 01:02:59.344 PMtrace| Tank Utility (Connect) | getToken()

app:4052024-04-25 01:02:59.340 PMtrace| Tank Utility (Connect) | RefreshDeviceStatus()

app:4052024-04-25 01:02:59.337 PMerrorError in getDevices: groovyx.net.http.HttpResponseException: status code: 401, reason phrase: Unauthorized

app:4052024-04-25 01:02:58.877 PMtrace| Tank Utility (Connect) | getToken()

app:4052024-04-25 01:02:58.875 PMtrace| Tank Utility (Connect) | getDevices

app:4052024-04-25 01:02:58.816 PMinfoInstalled with settings: [advAppDebug:false, autoDisabledreq:false, UserName:david@skymax.ca, resetAppAccessToken:false, showDebug:false, Password:bFVCDxBbdp4e]

app:4052024-04-25 01:02:53.318 PMwarn| Tank Utility (Connect) | RefreshDeviceState: no devices available

app:4052024-04-25 01:02:53.178 PMtracegetAPIToken()Requesting an API Token!

app:4052024-04-25 01:02:53.175 PMerrorError in getDevices: groovyx.net.http.HttpResponseException: status code: 401, reason phrase: Unauthorized

app:4052024-04-25 01:02:52.323 PMtracegetAPIToken()Requesting an API Token!

The reason you're not getting a device created is the 401 error

Thank you for your comment. I figured that was the case, but I don't know the cause of this error. When I run the Connect, it asks for my credentials and returns the result, "Authentication Succeeded". Is it that the token needs to be updated? I previously ran a curl command from terminal to get a API token. That worked properly, but I later decided that using @nh.schottfam's code I didn't need to insert my token manually. Do you have any ideas as to what I might be doing wrong?

Hey @thebearmay, sorry, I forgot to reply to your comment. After reading your suggestion, I again reviewed all of my devices but could not find anything that looked like it was the TankUtility monitor. I sorted by "Last Updated" as well, but nothing.

The error you're getting is at about line 254, which should mean that the initial request for the token was successful, but when the app attempts to use the token it's receiving the 401.

cc:@nh.schottfam

Thank you, @thebearmay. Do you know what might be going wrong that prevents the token from working?

The code looks good and I believe others have been successful in implementing, so not sure. I copied @nh.schottfam as he'd probably be the best qualified to determine the issue.

1 Like

@thebearmay, thanks very much for your help here. :slight_smile: And yes, I too have seen that others are able to use this without issues, which is why I think I must be missing something. Thanks again!

1 Like

It would be good to see all the logs for when you try to connect.

I would remove all apps of tank utility under he console -> apps

and remove all devices for tank utility under he console -> devices

I'm not asking you to uninstall source code.

You should also check there are not two copies of the source code under

  • he console -> apps code
    and
  • he console -> drivers code

Also make sure oauth is enabled for tank utility (connect) under he console -> apps code

I might reboot your hub now to ensure everything is happy

(MAKE SURE YOU HAVE Logs WINDOW OPEN)

then add the app again (he console -> apps -> + add user app

and fill in your credentials, and hit done,

You can use a private message to show all the logs, you can use a private message.

I assume you are using the same login you use for tank utility app.

1 Like

@nh.schottfam, thanks for taking the time to help. I really appreciate it. Tomorrow I'll do everything you said, but I believe this is exactly what I did yesterday. It takes no time to do it again though. Thanks again, and I'll update tomorrow!

@nh.schottfam, I'm back, and I did everything you suggested, as far as I know, except, I used Hubitat Package Manager instead of installing user app. Is that OK? I had installed user app before a couple of times, and couldn't get it to work (same symptoms as now, installed fine, no ability to communicate), so I moved to HPM. Here is the log file from my reinstalling. You did say that I didn't need to uninstall the code, but I tried without doing that, and it didn't work. Here is the log of the reinstall. Note that the second Tank Utility (Connect) is no longer installed, just log items from earlier:

Yes, I am using the same login that I use with the app, and that login returns "Authentication Succeeded".

Does any of this explain my issue? Same inability to get passed 401, reason phrase Unauthorized, and to see a new device. Note that the installation succeeded and so did the initial authorization, as shown in the package install.

Is it possible that there is a second version of the code out there, and that doing a search for the code in the HPM ends up finding old code?

Or, is it possible that while I have a working account in the Generac through which I can access the propane tank level, I don't pay any kind of service fee to Generac, and therefore access to the API is blocked for me?

Also, I received a message from TankUtility guys that Generac had taken it over, so I messaged Generac and they indicated that Generac no longer offers API access. All sort of confusing. Sorry for the long post.

I think you may be right that there is something about your account that does not seems to have api access (or generac changed the endpoint for their deployments).

@nh.schottfam, thanks again for your time. I guess that's confusing because, what could be different about my device than others? Is it a Canada thing? If I run it through a USA VPN, could that be a solution? Do I just have to find the right person at Generac that will flip a bit for me and it will work? I even have a Generac 20kW whole-house generator and automatic transfer switch. Anyway, if you or any others know who I could speak with, I'd really like that info. Cheers!

I would check if you have a primary account (ie account your equipment is connected to) in use.

It is strange that you can get a token (means login works), but then no devices are found....

@nh.schottfam, yes, having the successful authentication prior to it failing to work is also what puzzles me. After the successful authentication even an API token was granted, which is even more puzzling.

I don't understand what you mean by the primary account. Are you talking about a tank utility or generac account? Would you please further explain that? Whether Tank Utility app or Generac web-based app, both use the same login (in fact, the screens are seemingly identical, except for the "Generac" heading.)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.