Trying to get my head around Home assistant. Currently have a config to turn the lights out when no one is at home. this is the current error:
Check config
Invalid config for [automation]: [service] is an invalid option for [automation]
this is my config automation:
#lights when everybody leaves the house
- alias: 'Away Mode'
trigger:
platform: state
entity_id: device_tracker.life360_amma, device_tracker.life360_sabina_rahman, device_tracker.life360_shazad_ahmed
to: 'not_home'
action:
- service: light.turn_off
entity_id: group.all_lights
- service: notify.notify
data:
Message: "lights off"
Spacing/indentation⌠the hyphens for service need to be under action⌠then one space - service ⌠everything that is under/indented should be two spaces
I would suggest moving the device_trackers into a group. The result would be everyone is not_home, and one person can be home. Instead of every person being home or not home.
Negative, âgroupâ can only be defined once. Bring the people group in line with your other entries in your group yaml. I made a mistake using entity_id, it should be entities.
people:
name: People
entities:
- device_tracker.life360_amma
- device_tracker.life360_sabina_rahman
- device_tracker.life360_shazad_ahmed
Actually -
Not sure how to approach this. I have 3 people I track which is me, my wife and my mum. Both me and my wife live at the home location. Mum lives at a location called Mum. I would like to automate my lights at the home location. To go on and off when the last person lives/enters home. Currently my states are home, moving, mum, away or my work location. I have a group which has my life360 device codes This is my config. Is this correct? I suspect that my mum being at mum might cause it not to fire #lights when everybody leaves the house
alias: âAway Modeâ
trigger:
platform: state
entity_id: group.people
to: ânot_homeâ
action:
Iâm not sure what your concern is⌠that the Mum zone would get confused with someone being at âhomeâ?
I think it would be fine how you have it. I have a group called family which includes my wife and I and the in-laws⌠I have no issues with it setting the house/empty/not empty status. The wife and are tracked with iCloud3 and the in-laws phones are only tracked with asuswrt when then join my WiFi⌠but have yet to have it say the house is unoccupied when itâs not .
You just may want to consider combining a couple device trackers for each person as no one presence method seems to be 100% so previously we each had our own groups I tracked each of us with multiple trackers⌠group.brian_status contained the trackers then group.family (or group.people in your case) just contained the group.PERsOns_status
Now I just moved to the person component with just the two device trackers and have been very pleased with how well itâs been working.
You will probably find itâs ultimately going to depend on how quickly the device updates its location (I edited my above post with a little more info on using multiple trackers)