Nest thermostat as sensor to trigger lights how to? help needed

I want to use nest thermostat as a motion sensor to trigger hallway lights when someone comes home at night time

I am using following code a bit modified from a similar post in this forum but it doesn’t do anything please help as I am not that expert as just started using home assistant. Check config is all fine nothing wrong in it with check config result

  • alias: “Nest Light Turn on”
    trigger:
    • platform: event
      event_type: hallway_light_on
    • platform: state
      entity_id: binary_sensor.nest_away_mode
      to: ‘off’
      action:
      service: light.turn_on

any help will be highly appreciated

thanks

I’ve been experimenting with this a bit, but haven’t found the mode switching (or at least Home Assistant’s awareness of the mode switching) to be quite timely enough. Regardless, here’s an example of how you can use nest modes as triggers for automations…

- id: nest_is_away
  alias: Testing Nest away
  trigger:
    platform: template
    value_template: "{{ is_state_attr('climate.entryway', 'away_mode', 'on') }}"
  action:
    service: light.turn_off
    entity_id: group.stairwell

- id: nest_is_home
  alias: Testing Nest home
  trigger:
    platform: template
    value_template: "{{ is_state_attr('climate.entryway', 'away_mode', 'off') }}"
  action:
    service: light.turn_on
    entity_id: group.stairwell

climate.entryway is the entity_id for my nest thermostat. replace that with yours.

2 Likes

thanks a bit mod and it acutally aceived what i wanted thanks a million :slight_smile: but some other error from nest coming up

:frowning:

(MainThread) [homeassistant.setup] Error during setup of component nest
Traceback (most recent call last):

What generation do you have? Only entities I have are humidity and temp.

Manbearpig92Kyle Same here - I only have humidity and temp. Did you ever get anywhere with this? I resorted to this method https://community.home-assistant.io/t/exposing-google-home-away-mode-to-home-assistant/429528 - it is only for the entire house though… if you have multiple thermostats, they are all combined in the home/away so if you are wanting to have presence per thermostat, this method will not work unless you setup multiple “houses” for each thermostat not ideal but I guess it could work.

Works like a charm thanks for this solution. Was a little bit to early, it looks it ignores the value template.

I know this is an old thread. Is this still working for anyone? Checking Developer Tools, I see the following attributes for the climate entity for each thermostat. It’s missing the away_mode attribute so I don’t see how this would work. Any thoughts? I am hoping for occupancy status per thermostat, and not for the entire home.

hvac_modes: heat, off
min_temp: 50
max_temp: 90
preset_modes: none, eco
current_temperature: 70
temperature: 65
hvac_action: idle
preset_mode: none
friendly_name: Master Bedroom
supported_features: 17