Well, one more time I deleted the token file, reinstalled custom component, deleted old app from Oura web page, re-created new app etc. And boom, it started to work. I have no idea what was wrong earlier.
Anyway, great that this works now. Thanks!
Well, one more time I deleted the token file, reinstalled custom component, deleted old app from Oura web page, re-created new app etc. And boom, it started to work. I have no idea what was wrong earlier.
Anyway, great that this works now. Thanks!
Happy to hear Enjoy the data!
Just a quick FYI, I am strongly considering removing HACS support for this custom_component
as a protest to this. If it stops working, feel free to integrate manually.
HACS support now fully reverted in protest for the bad direction of the Home-Asisstant project. You can still install the code through manual install from GitHub.
Thanks for this, got it working.
First I didnāt have base_url setting because documentation says its not used any more, but then realized it was just removed and I have older version.
Then I had problem that token file couldnāt be written to disk. I tried to debug that, but eventually hardcoded the file path to /home/pi/.homeassistant
and it worked.
In Oura developer page you also have to give permission Allow server-side authentication (grant-type code)
Hi @nitobuendia
Is it possible to get component working with Home Assistant v 0.114.0, where base_url is deprecated?
Got this error to log every time when trying to get retrieve data:
2020-08-25 19:25:45 WARNING (SyncWorker_2) [homeassistant.components.http] Detected use of deprecated `base_url` property, use `homeassistant.helpers.network.get_url` method instead. Please report issue to the custom component author for oura using this method at custom_components/oura/api.py, line 236: base_url = self._sensor._hass.config.api.base_url
2020-08-25 19:25:45 ERROR (SyncWorker_2) [root] Oura API was unable to retrieve new API token.
2020-08-25 19:25:45 ERROR (SyncWorker_2) [root] Couldn't fetch data for Oura ring sensor
Thanks both for reporting issues.
For the base_url
, for a while I stopped updating my system due to the deprecation of YAML and never got the change myself. However, now that Iāve solved that and updating, I am happy to check to solve it. The migration is pretty straightforward as it just requires changing the base_url for a helper function. However, I would love to try making it compatible to as many versions; so thatās a bit of extra overhead. Would you mind opening an issue and I can take a look?
For the āOura API was unable to retrieve new API token.ā; sometimes this happens on the first load and fixes it afterwards. Iāve never been able to determine when the bug happens, but it never affected me. However, @MarkoMarjamaa your issue seems a bit different, if you can replicate, I can try to see if I can solve that as I havenāt experienced that and it feels like not working as intended.
Thank you!
I also get following oura_token_cache file to home assistant directory but after that those errors appear
{"code": "ABC123DEF456GHI789ABC123DEF456GHI1"}
and after that those warning/error combination in log. I though this would be due to version 0.144.0 and not supporting base_url
parameter anymore?
Iāll open new issue for this.
@tonfa80 @MarkoMarjamaa I have fixed the base_url issue (#2). Thanks for reporting. Iāve tested on 0.109.6 and last version (as of today) and it worked on both. Nonetheless, if you want to test it out, feel free to do so
Also, it seems you both mentioned other issues. If you still find some, feel free to report to github and I am happy to have a look.
Cheers,
Nito
Hey there,
Thanks for the custom component.
I am unfortunately unable to get the token
I am pretty sure i got through your documentation numerous time, my home assistant is hosted on cloudflare so i dont have to put a port number.
Just wondering if i should be selecting the following when i create an app on oura
Allow server-side authentication (grant-type code)
Allow client-side authentication (grant-type token)
Thanks
At least I couldnāt store the retrieved token file info into the custom_components/oura directory with my current configuration. Therefore I did what was mentioned earlier (I believe) and added a full path to hass usersās home directory in the custom_components/oura/api.py:
_TOKEN_FILE = '<add here full path to hass users home>/oura-token-cache-{}'
Or whatever works for you.
Thanks it works, upon going through this thread i found that this was critical during the setup
In Oura developer page you also have to give permission
Allow server-side authentication (grant-type code)
I changed all of my token files to always be on the same data/
directory. Perhaps why I didnāt see any issues. If this is failing for everyone, if you could share steps to reproduce, I can try.
The .storage
files remove the issue of having them around (although they still centralize the data in those files, though).
Is that step missing in the documentation? If yes, do you want to create an issue to add it on GitHub? Thanks!
Ok, it looks like there should be a line or two in readme that mentions that you should modify the token_file directory path to some directory under home-assistant account, otherwise the initial oura app authorization will not work as the token cache cannot be written to a local file.
I can create the issue, just not right now (too tired at the moment).
However, I was also unable to get any sensors created using the āXd_agoā style as those sensor lines all fail the Home Assistant syntax check for some reason. The āyesterday/monday/etc etcā is fine, but whenever I try to to use the ā2d_agoā or ā2days_agoā it will not pass the syntax check and whenever I can make it pass, the value will be āunknownā ā> I havenāt yet figured out how this is supposed to work or is there a bug somewhere.
Iād like to get some statistics showing current day, yesterday and a few days backwards from the current moment in order to get some visual graphs about the current trend.
When I click on the link in notification and click on Accept I get.
500 Internal Server Error
Server got itself in trouble
Any ideas?
No ideas, really?
got the same issue recently
For me it is working fine now
anything in particular did you do to get it working?
update: got it working, while updating the custom component i saw that my /config folder did not have the subfolder /data in it
So i create a new folder and the token file got created after 1 restart