Skip to content

How to set up per object motion sensor with MQTT in HomeAssistant? #5906

Closed Answered by edalquist
goodlucknow asked this question in Ask A Question
Discussion options

You must be logged in to vote

I believe I just figured out an approach using triggered template sensors:

- trigger:
    - trigger: mqtt
      topic: frigate/events
      payload: "ON"
      value_template: |-
        {{'ON' if (
            value_json.type in ['new', 'update'] and 
            not value_json.after.stationary and 
            value_json.after.label == 'person' and 
            (value_json.after.current_zones | select('contains', 'front_lawn')|list|count > 0)
          ) else 'OFF'}}
  binary_sensor:
    - name: "Frigate Motion - Person - Front Lawn"
      unique_id: frigate_motion_front_lawn
      state: "on"
      auto_off: 60
      device_class: motion

This doesn't have the downside of the non-match…

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@blakeblackshear
Comment options

@goodlucknow
Comment options

@goodlucknow
Comment options

@tschierer
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by NickM-27
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants