Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Upgrade python-nest, add security_state sensor, nest.set_mode service set ETA as well #14901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 12, 2018

Conversation

awarecan
Copy link
Contributor

@awarecan awarecan commented Jun 10, 2018

Description:

Upgrade python-nest to 4.0.2, which allows follows changes possible.

Add security_state sensor

security_state is provided by Nest Security API, please note, it is NOT API for Nest Secure Alarm System.
You can use this sensor to convert your HA + Nest Cam to a cheap security system

When all family members are away from home, the structure enters away mode. When a Nest Cam detects a person, the Camera API's /last_event/has_person field changes to true.

These two states work together to trigger the Works with Nest Security API, as follows:

  • If a Nest Cam detects the presence of a person while the structure is in away mode, the structure enters deter mode.
  • When your product detects that the structure is in deter mode, your product can make the home "pretend" to be occupied by altering the home environment in some way, such as turning on the lights, playing music, or opening blinds to make an intruder more visible.

In this way, the home becomes a less inviting target for attack.

Set ETA

nest.set_mode service extended to allow set ETA when you set away mode.

In some cases, users have a 3rd-party app that uses GPS to provide estimated time of arrival (ETA) data to the Nest API. In other cases, the user might use an app to manually enter their ETA. Or maybe the ETA is calcluated based on the user's regular schedule.

ETA apps that are integrated with the Nest Thermostat cause the thermostat to begin warming or cooling the home before the user arrives.

When the ETA/thermostat integration exists in the user's account, the ETA data is available for other Works with Nest developers to use in their Works with Nest integrations.

After the ETA is input into the Nest service, another Works with Nest integration can use it as a signal to prepare the home for the user's arrival.

See here for more information

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5518

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Small comment on grammar.

description: Optional ETA window. Default is 1 minute.
example: 0:5
trip_id:
description: Optional the identity of a trip. Use same trip_id will update the estimation for a trip.
Copy link
Member

@MartinHjelmare MartinHjelmare Jun 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional identity of a trip. Using the same trip_ID will update...

@MartinHjelmare
Copy link
Member

Can be merged when build passes.

@syssi syssi merged commit 30111ea into home-assistant:dev Jun 12, 2018
@ghost ghost removed the in progress label Jun 12, 2018
vol.Required(ATTR_HOME_MODE): vol.In([HOME_MODE_AWAY, HOME_MODE_HOME]),
vol.Optional(ATTR_STRUCTURE): vol.All(cv.ensure_list, cv.string),
vol.Optional(ATTR_TRIP_ID): cv.string,
vol.Optional(ATTR_ETA): cv.time_period_str,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a time_period instead of time_period_str.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in #14938

@balloob balloob mentioned this pull request Jun 22, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
@ghost ghost removed the platform: sensor.nest label Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants