orcasgit / python-nokia

Library for the Nokia Health API
Other
57 stars 23 forks source link

Usage in Home-assistant #23

Open khzd opened 5 years ago

khzd commented 5 years ago

Hello thanks for this new release of python-nokia, now again withings :)

I'm trying to integrate it with home-assistant and i'm meeting a challenge around the callback url I tried with success the nokia command with http:/home-assistant.io as a call back, with redirect me to home-assistant.io:) but this is not the target usage, need to back called from My home-assistant. would appreciate any help? do you know if someone is using this release with home-assistant ? found no trace oh github :( cheers

jmtatsch commented 5 years ago

Not sure if my custom component https://github.com/jmtatsch/Home-Assistant-Config/blob/master/custom_components/sensor/nokia_health.py survived the new update but it may give you some hints.

brad commented 5 years ago

@khzd I don't know of anyone using it for home assistant but I know someone using it for SmartHomeNG https://github.com/smarthomeNG/plugins/tree/master/nokia_health A user named psilo99 managed to integrate the oauth2 process into the smarthomeng web interface if you want to come on to gitter to pick their brain about it.

psilo909 commented 5 years ago

@jmtatsch from what i experienced you will definitely need to update your component. the whole auth process changed. not sure how that can be implemented in home assistant, but you will need a web interface to allow the user to run through that process. you will also need something to save the tokens to. in our case i used items, that are persisted to the file system or to a database.

IMPORTANT: you dont need an internet URL as callback.. just an ordinary website in your LAN will be sufficiant.

By the way: the new version is only in develop branch, but completely functional: https://github.com/smarthomeNG/plugins/tree/develop/nokia_health

The callback (code parameter) is handled here: https://github.com/smarthomeNG/plugins/blob/develop/nokia_health/__init__.py#CL375

khzd commented 5 years ago

@jmtatsch sorry i didn't precise that it was your HA sensor that I was migrationg to 1.0.0. the Auth2 is implemented in HA and the configurator is asking to register in the correct url, and unfortunately I'm stick on the callback : what is the code that i need to configure in the withing site?

NB: consumer key, client id ... are all ok, but the nokia site is responding that the callback is either missing (nokia-healh 0.4.0)
or incorrect for nokia_health 1.0.0 all from @brad. cheers

MattL0 commented 5 years ago

No links is working here :(

vangorra commented 5 years ago

Home assistant now has a withings component built in that uses this api.

bmxp commented 3 years ago

We get errors installing this lib due to outdated dependencies:

ERROR: nokia 1.2.0 has requirement arrow<0.13,>=0.12, but you'll have arrow 0.13.1 which is incompatible.
ERROR: nokia 1.2.0 has requirement cherrypy<17.4,>=17.3, but you'll have cherrypy 18.6.0 which is incompatible.
ERROR: nokia 1.2.0 has requirement requests<2.20,>=2.19, but you'll have requests 2.25.0 which is incompatible.

@brad could you probably update the dependencies? @vangorra do you have similar problems in HomeAssistant?

@psilo909 could you check if we can provide a PR?

vangorra commented 3 years ago

The withing api used by home assistant does but have this issue.