Nest camera motion entities

Hi all

I’m looking for a little help with the Nest integration.

I am all setup and able to view 5 camera entities, all added into the dashboard with no issues, however despite several attempts, I am unable to see any motion sensor entities from the cameras - I’m just seeing the cameras themselves:

integration

As far as I can tell, I have SDM setup correctly as HA is receiving events:

Products -> 0 -> DisplaySkuAvailabilities -> 0 -> Sku -> MarketProperties -> 0 -> FirstAvailableDate
  none is not an allowed value (type=type_error.none.not_allowed)
Products -> 0 -> DisplaySkuAvailabilities -> 1 -> Sku -> MarketProperties -> 0 -> FirstAvailableDate
  none is not an allowed value (type=type_error.none.not_allowed)
2021-01-14 08:56:47 DEBUG (MainThread) [homeassistant.components.nest] Event Update dict_keys(['sdm.devices.events.CameraMotion.Motion'])
2021-01-14 08:56:48 DEBUG (MainThread) [homeassistant.components.nest] Event Update dict_keys(['sdm.devices.events.CameraMotion.Motion'])
2021-01-14 08:56:49 ERROR (MainThread) [homeassistant.components.xbox] Unexpected error fetching xbox data: 2 validation errors for CatalogResponse
Products -> 0 -> DisplaySkuAvailabilities -> 0 -> Sku -> MarketProperties -> 0 -> FirstAvailableDate
  none is not an allowed value (type=type_error.none.not_allowed)
Products -> 0 -> DisplaySkuAvailabilities -> 1 -> Sku -> MarketProperties -> 0 -> FirstAvailableDate
  none is not an allowed value (type=type_error.none.not_allowed)
Traceback (most recent call last):

Is there some additional configuration that I’m missing in setting up the motion sensor entities from the Nest Cams?

Any ideas greatly accepted!

Many thanks

Andy

I’m having exactly the same issue, with the same events in my log as Andy:

2021-01-19 16:27:03 DEBUG (Thread-LeaseMaintainer) [google.cloud.pubsub_v1.subscriber._protocol.leaser] The current deadline value is 10 seconds.
2021-01-19 16:27:03 DEBUG (Thread-LeaseMaintainer) [google.cloud.pubsub_v1.subscriber._protocol.leaser] Snoozing lease management for 8.887169 seconds.
2021-01-19 16:27:04 DEBUG (Thread-ConsumeBidirectionalStream) [google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager] Processing 1 received message(s), currently on hold 0 (bytes 0).
2021-01-19 16:27:05 DEBUG (Thread-ConsumeBidirectionalStream) [google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager] Sent request(s) over unary RPC.
2021-01-19 16:27:05 DEBUG (Thread-ConsumeBidirectionalStream) [google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager] Released held message, scheduling callback for it, still on hold 0 (bytes 0).
2021-01-19 16:27:05 DEBUG (MainThread) [homeassistant.components.nest] Event Update dict_keys(['sdm.devices.events.CameraMotion.Motion'])
2021-01-19 16:27:05 DEBUG (Thread-CallbackRequestDispatcher) [google.cloud.pubsub_v1.subscriber._protocol.dispatcher] Handling 1 batched requests
2021-01-19 16:27:05 DEBUG (Thread-CallbackRequestDispatcher) [google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager] Sent request(s) over unary RPC.
2021-01-19 16:27:12 DEBUG (Thread-LeaseMaintainer) [google.cloud.pubsub_v1.subscriber._protocol.leaser] The current deadline value is 10 seconds.
2021-01-19 16:27:12 DEBUG (Thread-LeaseMaintainer) [google.cloud.pubsub_v1.subscriber._protocol.leaser] Snoozing lease management for 0.354556 seconds.

Would appreciate any assistance! Would love to get the motion sensor events up and running.

Hi,
It doesn’t add extra entities – the preferred approach is to use Automations via device triggers for motion events.

See https://www.home-assistant.io/integrations/nest/#automation-and-device-triggers which has screenshots of the automation flow and links.

Got it, thanks mate! I was expecting them to come through on the event bus, I think.

I found this thread that suggested using Node Red and the events:all node filtered by event_type: nest_event to grab them, as a slightly more powerful alternative to Automations.

Thanks allenporter!

I was looking at pulling in the nest_event as a trigger to an automation, but couldn’t figure out how to distinguish the cameras that way. The solution you suggested is perfect for what I need - so thanks!

I didn’t occur to me that HA had already picked them up as trigger events!!

@Drewgy, I know this thread is kind of old but I just faced the same issue and solved it using some template sensors. I found this as I was being lazy and tried to find template configuration in the forum to save me 5min going through the documentation…lol

Here is how to transform Nest Doorbell events into binary sensors using template sensors. Just include the text bellow in your configuration.yaml, replacing <replace by your device id> by your device id.

# Templates
template:
  # Front Door Motion 
  - trigger:
      - platform: event
        event_type: nest_event
        event_data:
          device_id: <replace by your device id>
          type: camera_motion
      - platform: event
        event_type: nest_event
        event_data:
          device_id: <replace by your device id>
          type: person_detected
      - platform: event
        event_type: nest_event
        event_data:
          device_id: <replace by your device id>
          type: doorbell_chime
    binary_sensor:
      - name: "Front Door Motion Sensor"
        device_class: motion
        auto_off: 60
        state: "on"

  #Front Door Doorbell
  - trigger:
      - platform: event
        event_type: nest_event
        event_data:
          device_id: <replace by your device id>
          type: doorbell_chime
    binary_sensor:
      - name: "Front Door Doorbell"
        auto_off: 15
        state: "true"
7 Likes

Nice! Thanks for sharing this recipe as I see this question at least once a month here.

@gmlupatelli

I really want to do this and get it to work but despite my config.yaml indicating I have no errors when I set it up, it doesn’t populate my entities with the new motion options.

Any further ideas? I can share screenshots of how I set it up if you would like to take a look.

What device are you trying to set up? I just discovered that the Nest API is broken for some camera types, and doesn’t report the events.

So far that is what I know:

  • Working Cameras:

    • Nest Doorbell (old one)
  • Not Corking Cameras:

    • Google Nest Hub Max
    • Outdoor/Indoor Camera (2021) - running on battery or power

First gen indoor (wired) Nest camera with people and motion detection. They are recognized through the Nest Google API I set up, e.g., I can see all my nest devices there now but don’t have entities like “no motion detected” which is what I need for my automation ideas.

Option 1: use the triggers from the camera device:

Option 2: create template sensors

  • find your camera id
    1. Create an empty automation
    2. Select your camera as a Device, click the 3 dots and select Edit in YAML
    3. Save the device ID for later
    4. Open your configuration.yaml file and include a sensor template
# Templates
template:
# Templates
template:
  # Front Door Motion 
  - trigger:
      - platform: event
        event_type: nest_event
        event_data:
          device_id: <replace by your device id>
          type: camera_motion
      - platform: event
        event_type: nest_event
        event_data:
          device_id: <replace by your device id>
          type: person_detected
    binary_sensor:
      - name: "Front Door Motion Sensor"
        device_class: motion
        auto_off: 60
        state: "on"
  1. Go to Configuration, Server Controls, YAML configuration reloading and reload Template Entities or restart Home Assistant

Learn more about template sensors here

3 Likes

Thanks again.

I almost have it working but receive the follow error in the log:

Invalid config for [template]: [binary_sensor] is an invalid option for [template]. Check: template->binary_sensor. (See ?, line ?).

Any hints or suggestions are appreciated.

Can you paste your yaml? May help someone spot the error.

Sure thing.

# Configure a default setup of Home Assistant (frontend, api, etc)

default_config:

# Text to speech

tts:

- platform: google_translate

group: !include groups.yaml

automation: !include automations.yaml

script: !include scripts.yaml

scene: !include scenes.yaml

# Next Entity Configuration

nest:

  client_id: ***

  client_secret: ***

  project_id: cf2b6582-401d-44b5-8c85-f5bd58bca76e

  subscriber_id: projects/show-and-hide-rows/subscriptions/Home_Assistant_Nest_Sub_Pub

# Templates
template:
  # Garage Motion
  - trigger:
  - platform: event
    event_type: nest_event
    event_data:
      device_id: 83c502c3465be68c6474766ff85a1b44
      type: camera_motion
   - platform: event
     event_type: nest_event
     event_data:
        device_id: 83c502c3465be68c6474766ff85a1b44
        type: person_detected
     binary_sensor:
        - name: "Garage Motion Sensor"
          device_class: motion
          auto_off: 60
          state: "on"

Hey sorry please delete the secrets

1 Like

Oops. Thanks. Doing too much at once.

So what I was looking for was the yaml for the template sensors (with the errors in it) and not really the nest configuration.

@allenporter - Unfortunately I do not have a separate template ymal. Someone along this path the instructions indicated that the templates go in this configuration file. Should I make a separate location?

From that error messages it implies you copied the yaml posted above somewhere, right? Paste that here? Maybe format or the indent looks incorrect?

1 Like
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Next Entity Configuration
nest:
  client_id: [client]
  client_secret: [secret]
  project_id: [project id]
  subscriber_id: projects/show-and-hide-rows/subscriptions/Home_Assistant_Nest_Sub_Pub

# Templates
template:
  # Garage Motion
  - trigger:
      - platform: event
        event_type: nest_event
        event_data:
          device_id: 83c502c3465be68c6474766ff85a1b44
          type: camera_motion
      - platform: event
        event_type: nest_event
        event_data:
          device_id: 83c502c3465be68c6474766ff85a1b44
          type: person_detected
        binary_sensor:
          - name: "Garage Motion Sensor"
            device_class: motion
            auto_off: 60
            state: "on"

Should I put the templates in their own section/file area?
Here is an image of my file config area in HA