FilipDem / Domoticz-NEST-plugin

NEST Plugin for Domoticz using the Google credentials.
13 stars 4 forks source link

Plugin not working - General error TaskHandler: 'Away' #35

Closed Dens75 closed 2 years ago

Dens75 commented 2 years ago

Hi,

First of all great work to develop this plugin!

I installed domoticz on a docker container and followed your instructions. When starting domoticz only one device is created followed with an error in the logs: General error TaskHandler: 'Away'

I checked if I installed all python3 libraries are installed and they are.

When running from terminal in docker container: python3 plugin.py The result is: File "plugin.py", line 66, in <module> from domoticz_tools import * File "/opt/domoticz/plugins/GoogleNest/domoticz_tools.py", line 16, in <module> import Domoticz ModuleNotFoundError: No module named 'Domoticz' root@Domoticz:/opt/domoticz/plugins/GoogleNest#

Any idea what I'm missing or where to look?

FilipDem commented 2 years ago

You cannot run the plugin.py outside domoticz... To troubleshoot, it is better to start the nest.py (as indicated in the section 'Configuration' of the readme. !! The NEST Thermostat E is not supported. Do you get a decent output when running the nest.py? Are your devices recognized?

Dens75 commented 2 years ago

When testing with nest.py and my token en cookie it look likes it's reading out my Nest and Smoke Protector but finishes with: Traceback (most recent call last): File "nest.py", line 493, in <module> log(" Set Away: {}".format(thermostat.SetAway(device, infoNest['Away']))) KeyError: 'Away' Only the Away switch is created

FilipDem commented 2 years ago

Could you put the complete output pls?

Dens75 commented 2 years ago

Got bearer token Got access token and user id (xxx) and remains valid until 2022-02-12T21:40:25.290Z. Got user Got nest devices 2: thermostats ['09AA0xxx'] - protects ['18Bxxx'] General Nest information: {} Nest Thermostat 09AA0xxx: {'Target_temperature': 21.5, 'Current_temperature': 21.73, 'Temperature_scale': 'C', 'H umidity': 38, 'Eco': False, 'Heating': False, 'Target_mode': 'heat', 'Target_temperature_low': 20.0, 'Target_temperature_ high': 24.0, 'Where': 'Family Room', 'Auto_away': 0} Temperature set to 21.5 Set Temperature: True Traceback (most recent call last): File "nest.py", line 493, in <module> log(" Set Away: {}".format(thermostat.SetAway(device, infoNest['Away']))) KeyError: 'Away'

FilipDem commented 2 years ago

Very strange that your General Nest information is empty. Normally you should got sth like: General Nest information: {'Name': 'xxx', 'Away': False, 'City': 'xxx', 'Country_code': 'BE', 'Postal_code': 'xxxx'}. You didn't delete it from the logging for privacy? This is information from Nest that gives also the Away status... And that's why you got the error afterwards...

Could run this version of the file: nest.py.txt (you have to remove the .txt extension)

This dumps all the info coming from NEST to a file called json_date.json. Could you then return me the file? I can take a look what is going wrong.

Dens75 commented 2 years ago

Hi, When you mentioned there should be more information I went looking in my Nest account. I saw that I didn't fill in my address completely. After completing my address and running the nest.py I came back all ok and after restarting Domotic all devices were created and are working! Thanks for you help and great work. I will make a donation!

FilipDem commented 2 years ago

Thanks!