Trying to do something that should be stupidly simple but I am getting nowhere, searching and reading many blogs are just complicating things
I want to add a function into several of my automations that will not do something like sound an alarm if someone enters the gate if I am home
I have setup zones but don’t know how to use them in an automation
This is to detect if myself or my wife are home (I see us in the zone map) how to use this info.
If we are not home send warning or sound if someone enters the garden
If we are home don’t send a warning
Seems simple but I hit a brick wall.
Tried the below but seems to not recognise
I have used this template sensor for years cause it just works. there may well be better easier way to do it but 8 years or so ago this is how I did it.
- binary_sensor:
- default_entity_id: binary_sensor.someone_home
icon:
"{% if is_state('binary_sensor.someone_home','on') %} mdi:home-account
{% else %} mdi:home-outline {% endif %}"
name: Someone Home
state:
"{{ is_state('person.person1','home') or is_state('person.person2,'home')
}}"
Checked my automation, i had the spelling correct. Just the listing on here i mityped.
I still have a problem that there is a ta let at home used for disp.ay panel that shows at home, so need to try to find a way of detecting my or my wife phone home, or somehow ignore the tablet,
Can you paste in your config rather than re-typing it? Judging by your post typing accuracy there may be other issues.
The state of zone.home should reflect the number of Person entities in that zone:
…so unless you have a Person associated with your display tablet, that shouldn’t matter. The device tracker will say home but won’t be counted in the zone state.
Hi All
Thanks for the suggestions
Agree- The typing is not good My Bad using the tablet (not at home when typing) not a PC.
‘Arh’ I think I will add a user for the tablet, did not think of that being an issue
I will create a new user and not add it to tracking and try again tomorrow.
Thanks all for the suggestions
Not into using AI though.
Finally got some time to update my automation, it should only message me when I am not at home (will expend to include wife after working) however it sends me message even I am home, is this a problem with condition -1
alias: main door open
description: ""
triggers:
- type: opened
device_id: f6195c9615af1f2d56e951d9cd6e3232
entity_id: f1db7d977d2968c93c3f1065dd058a6e
domain: binary_sensor
trigger: device
conditions:
- condition: numeric_state
entity_id: zone.home
below: 1
actions:
- action: notify.mobile_app_berni_phone
metadata: {}
data:
message: the main door is open
title: main door
mode: single
Check the state of zone.home when there is no one home, when just you are home and when you are both home. This will give you an idea of what is happening. My guess is your zone always thinks someone is home. if you use the code I posted above you can choose which users to add to the sensor. This makes stuff like your tablet being home not an issue, but this is still my guess even if you changed the user.
found a solution to the problem.
By using device tracker this shows if “Home” or “Not at Home”
and just track our mobile phones, this will ignore the tablets as I am not tracking them.
tested it working OK