Skip to content

FilipDem/Domoticz-NEST-plugin

Repository files navigation

Donation

It took me quite some effort to get the plugin available. Small contributions are welcome...

Use your Mobile Banking App and scan the QR Code

The QR codes comply the EPC069-12 European Standard for SEPA Credit Transfers (SCT). The amount of the donation can possibly be modified in your Mobile Banking App.

5 EUR 10 EUR

Use PayPal

Domoticz-NEST-plugin

Nest plugin for Domoticz using the Google account credentials.

This is a workaround solution for Nest thermostats and Nest Protect devices in Domoticz. It does not use any official API because of non-existance. Nest/Google announced them only to be available by end of 2020. Nest Thermostat E (UK/EU version) is not supported.

The plugin creates the following devices:

  • General Nest status
    • Away (showing the combined status delivered by Google Nest)
    • Weather devices
  • Nest Thermostat:
    • Thermostat Eco-mode
    • Thermostat Heating
    • Thermostat Temperature/Humidity (indoor)
    • Thermostat Heating temperature
    • Thermostat Away (showing the away status indicated by the thermostat only)
  • Nest Protect:
    • Nest Protec status

Installation (linux)

Follow this procedure to install the plugin.

  • Go to "~/Domoticz/plugins" with the command cd ~/Domoticz/plugins
  • Create directory "GoogleNest" with the command mkdir GoogleNest
  • Copy all the files from github in the created directory
  • Be sure the following python3 libraries are installed: requests, pytz and tzlocal
    • use pip3 list to verify if the libraries are installed
    • to install the missing libraries: sudo pip3 install <library>
  • Restart Domoticz with sudo systemctl restart domoticz.service

Adding Nest to Domoticz

In the Setup - Hardware,

  • add the Type (dropdown) Nest Thermostat/Protect Google
  • give the device a Name (eg Nest)
  • for the fields issue_token and cookie, follow the guidance in the section hereafter (Configuration)
  • for the settings minutes between updates, recommendation is to avoid below 2 minutes

Configuration

For the plugin you need to enter two values in the Domoticz hardware plugin settings: issue_token and cookies. The values of issue_token and cookies are specific to your Google Account. To get them, follow these steps (only needs to be done once, as long as you stay logged into your Google Account):

  • Open a Chrome browser tab in Incognito Mode (or clear your cache).
  • Open Developer Tools (View/Developer/Developer Tools).
  • Click on Network tab. Make sure Preserve Log is checked.
  • In the Filter box, enter issueToken.
  • Go to https://home.nest.com, and click Sign in with Google. Log into your account.
  • One network call (beginning with iframerpc) will appear in the Dev Tools window. Click on it.
  • In the Headers tab, under General, copy the entire Request URL (beginning with https://accounts.google.com, ending with nest.com). This is your $issue_token.
  • In the Filter box, enter oauth2/iframe.
  • Several network calls will appear in the Dev Tools window. Click on the last iframe call.
  • In the Headers tab, under Request Headers, copy the entire cookie value (include the whole string which is several lines long and has many field/value pairs - do not include the Cookie: prefix). This is your $cookies; make sure all of it is on a single line.

Remark: after the procedure above, you can close the browser, however you cannot logoff/logout from your nest account! Otherwise the credentials will no longer be valid.

If you have problems, it is recommended to test with the nest.py plugin outside Domoticz. It is developed in python3 (substitute the proper values for xxx):

export NEST_ISSUE_TOKEN='xxx'
export NEST_COOKIE='xxx'
python3 nest.py

Possible connection problems

When there are connection problems due to wrong issue_toke and/or cookie, a Domoticz error will be generated on regular basis. However the error won't get away (and devices will not be updated) as long as the plugin is not restarted (use the update button in the Hardware tab).

Similar behavor happens when the generated Google access tokens (based on issue_token and cookie) are no longer valid. This could happen when you logged out the session that was used to recuperate the issue_token and cookie.

Typical errors that will be generated are:

  • API returned error: ...
  • Invalid IssueToken/Cookie: ...
  • API request failed ...
  • API response status code

Device creation

After the start of the plugin the devices will be automatically created for:

  • Away (on/off)
  • Heating (on/off)
  • Eco mode (on/off)
  • Temp/hum (temperature and humidity)
  • Heating Temp (thermostat temperature)
  • Away (thermostat) (*)
  • Protect (on/off)
  • Weather devices (Temp/hum and Wind)

(*) This device is by default set as "not used". Go to the Setup - Devices to make the device visible.

The names of the devices are created automatically based on the location settings of your Nest devices with name_of_the_hardware - location type_of_switch. The weather device has a dedicated name based on the city (name_of_the_hardware - city type_of_switch). As the away status is independent of the devices (and is in fact a combination of all the devices), the name is automatically created as name_of_the_hardware - Away.

  • name_of_the_hardware: name as entered in the Setup - Hardware screen
  • location: as set up in the nest account, some possible values 'Entryway', 'Kitchen', 'Living Room', ...
  • type_of_switch: 'Heating', 'Eco mode', 'Temp/Hum', 'Heating Temp', 'Protect', 'Temp/Hum', 'Wind', 'Away'

For each created device a remark is added to the description, like 'Do not remove: [Family Room Heating]'. The part in square brackets (inclusive) is needed to make this plugin work. It allows you changing the name of devices (but do not change the tag in the description).

Migration

Check the description of the "Away"-device by Switches - Edit.

If the description still contains the location, remove the location part. As an example, 'Do not remove: [Family Room Away]' should be modified to 'Do not remove: [Away]'.

Alternatively (if not done), a new "Away'-device will be created automatically (and you can remove the old one).

Success!

Don't forget a small gift by using the donation button...

About

NEST Plugin for Domoticz using the Google credentials.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages