philippelt / netatmo-api-python

Netatmo connect API python client (for Netatmo information, see https://dev.netatmo.com)
GNU General Public License v3.0
186 stars 118 forks source link

lnetatmo - WARNING: Your current token scope do not allow access to Home data #79

Closed AFI4711 closed 5 months ago

AFI4711 commented 5 months ago

After generation of a

and updating the ~/.netatmo.credentials file. Running python3 lnetatmo.py shows error message: lnetatmo - WARNING: Your current token scope do not allow access to Home data Even if I change the scope (instead of "read_station" I added nearly every read* scopes) the error messages remains the same. With these credentials the access to my netatmo data succeeds using node-red and curl -X GET "https://api.netatmo.com/api/getstationsdata?device_id=**********&get_favorites=false" -H "accept: application/json" -H "Authorization: Bearer ********". What do I wrong? I'm using a "Weather Station" and 1 "Outdoor Module" only.

philippelt commented 5 months ago

Did you add the exact required scope (which is unexpected) as described in this issue : https://github.com/philippelt/netatmo-api-python/issues/56#issuecomment-1638546613

AFI4711 commented 5 months ago

Now I add one of these scopes and the access succeeds but:

python3 lnetatmo.py lnetatmo - WARNING: No Smokedetectors found lnetatmo - WARNING: No Cameras found lnetatmo - WARNING: No Persons found lnetatmo - WARNING: No events found lnetatmo - WARNING: Your current token scope do not allow access to Thermostat Traceback (most recent call last): File "/home/andi/Computer/src/python/netatmo/netatmo-api-python-master/lnetatmo.py", line 1110, in thermostat = ThermostatData(authorization) File "/home/andi/Computer/src/python/netatmo/netatmo-api-python-master/lnetatmo.py", line 364, in init self.rawData = resp['body']['devices'] TypeError: 'NoneType' object is not subscriptable

Then I add "read_station", "read_thermostat", "read_camera", "read_presence" and "read_smokedetector".

In this case lnetatmo - WARNING: Your current token scope do not allow access to HomeCoach!

After I added "read_homecoach" the script finishs successfully:

python3 lnetatmo.py lnetatmo - WARNING: No Smokedetectors found lnetatmo - WARNING: No Cameras found lnetatmo - WARNING: No Persons found lnetatmo - WARNING: No events found lnetatmo - WARNING: No thermostat avaible for testing lnetatmo - WARNING: No HomeCoach avaible for testing lnetatmo - INFO: OK

Thank your for your quick help!