so I need to create 2 sensors - the first that uses the ‘https://api.uhooinc.com/v1/generatetoken’ POST request to extract a bearer access token (which only lasts 10 minutes).
just for info - my plan was to trigger sensor 1 every 8 minutes or so, so that the device sensor values always returned a valid access token and therefore provide uninterrupted data. No idea if Im going about thus the right way.
Are you able to share the current configuration of your rest sensors (without any personal information)? And could you please share the exact error message? Do you have an issue with both sensors or only one?
Also, authentication: basic should not be necessary because you are not specifying username or password.
Lastly, the order in which Home Assistant updates these sensors is not in your control. That’s why there is a chance that the two sensors that require the token fail because the sensor that retrieves the token has not been updated yet.
One way to get around that is to use an automation to update the sensors that require the token. You can set the scan_interval to a very large interval and build an automation that checks in a condition if the token is available and only then triggers an update of the two sensors.
i got this working in the end - it was a combination of the api key refreshing every-time I reloaded the rest sensors (doh - ofcourse) and the character limit on the restful integration.
So i used value template to only output one value on the sensor then used attributes for the rest
Have browsed through the API documentation a bit, it would be interesting to write a native integration for it so that you can use the data even more easily in Home Assistant
Hello all, conform the documentation you have to get the API from your account at the link uHoo. I however have a premium account (https://premium.getuhoo.com) were I can’t find the API section ti create a Client ID.
Does anybody else has an idea where to get it? If even possible?