Device_Tracker "not_home" not functional

hello, I have the problem with the device tracker in a snapshot automation with regard to a camera that it does not accept the status “not_home” as OK status. if I test the automation with the status “home” the condition runs on green, with “not_home” this is red.

my .yaml :
‘’’
alias: Snapshot
description: ‘’
trigger:

  • platform: state
    entity_id:
    • binary_sensor.hauseingang_person_detected
    • binary_sensor.hauseingang_motion
      to: ‘on’
      condition:
  • condition: state
    entity_id: group.all_person
    state: home
    action:
  • service: camera.snapshot
    data:
    filename: /config/www/cameraHof.jpg
    target:
    entity_id: camera.hauseingang
    ‘’’
    the test of the condition is performed under settings → automations → and then in the automation under “Test” to the right of the condition. Here a red X appears with “not_home” and not a green hook. does anyone have an idea where the error can lie? “home” and “not_home” is not so difficult to make a mistake there.

if it’s green check with “home” it’s usually shows “red” if not_home, can’t be both

Thou im really not sure what you try to accomplice here… IF person_detected/ + motion detected at house-entry , and IF group.all_person is “home” … Then take a snapshot ?

EDIT: above means that IF group.all_person is “not_home” the automation/condition will “fail” … Abort “Action” if “person_detected” + “motion” detected ( i.e red )

Not to mention: If one of the binary-sensors is not “on” ( at the same “very moment” ), it wont even check the condition(s) … in think you should rethink :slight_smile:

Could you please format your post correctly?

I was tired in my eyes, or really didn’t “noticed” it as “code” :slight_smile:

That was aimed at @BoFrost76

Sorry, i trie it a little bit easier.

i only want to take a snapshot when a person is detected and nobody from group,all_person is at home.
when I replace “home” with “not_home” the automation runs on red, so it doesn’t work.

Unbenannt

No. That is worse.

Do not post pictures of code.

We cant use that by copying / editing / and pasting. Just format your posts correctly as per the instructions I linked to.

This is the code formatter…

Sorry, my fold. i only want to take a snapshot when a person is detected and nobody from group,all_person is at home.
when I replace “home” with “not_home” the automation runs on red, so it doesn’t work. i hope this format is correct now

- id: '1654534710909'
  alias: Snapshot
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.hauseingang_person_detected
    to: 'on'
  condition:
  - condition: state
    entity_id: group.all_person
    state: home
  action:
  - service: camera.snapshot
    data:
      filename: /config/www/cameraHof.jpg

{{ states('group.all_person') }}

IS that showing ‘home’ in the template editor?

Then this would be correct:

- id: '1654534710909'
  alias: Snapshot
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.hauseingang_person_detected
    to: 'on'
  condition:
  - condition: state
    entity_id: group.all_person
    state: not_home
  action:
  - service: camera.snapshot
    data:
      filename: /config/www/cameraHof.jpg

What do you mean by “runs on red”?

Also how did you define the group?

my group is :

  all_devices:
    name: all_devices
    all: true
    entities:
      - device_tracker.ibo
      - device_tracker.iphone_von_susann
 

When i am testing this condition i get with no_home a red Cross, with Home a ok.


Is everyone home?

If so, then that is working properly. The tester tells you whether or not the condition is currently true. If everyone is home, then not_home should return False.

Oh man, that’s a huge ignorance on my part, sorry guys. I was probably too stupid

1 Like