Hi all
I am new to this Home Assistant game and I recently was able to get smart lights setup in the garden and integrate my Protect into it for some automations
So far automations work fine but there is some fine tuning required in some of them and I was wondering if I could get some help
Currently I have two automations for the garden lights, one for power on and one for power off. They both use Unifi Protect cameras API, in particular the AI Person/Animal Detection. And I have two cameras tied into this automation, both in the garden at two different points
Power on works great, person/animal walks into the frame and all lights turn on in the garden
Issue seems to be with power off, ill be in the frame of the camera (Lets say I sit down on a chair) the lights stay on for maybe 5 minutes and then turn off.
Is this more of an issue on the Protect side as I reviewed the footage back and I can see one camera sees me and draws a box around me, the other doesnt see me and then cuts off the lights as its a trigger, it sends a response back to HA saying that Person is not detected.
Is there a way maybe I can balance this such as “Only if both cameras say person not detected, the lights will turn off” rather than one?
I have a copy of the code here in YAML
alias: Garden Lights (Power off)
description: ""
triggers:
- type: turned_off
device_id: 55383f660fb81204eba3d43bac523f94
entity_id: 6ebc6e5b36c9f5a78f4bb172fd0868f4
domain: binary_sensor
trigger: device
- type: turned_off
device_id: 55383f660fb81204eba3d43bac523f94
entity_id: ff9a9cd9c312e243a3cf62b993b28cdd
domain: binary_sensor
trigger: device
- type: turned_off
device_id: 425193de48b8170f9d5aa9286d09f844
entity_id: 94e962bc43eedf9c9edfd332f51722a6
domain: binary_sensor
trigger: device
enabled: true
- type: turned_off
device_id: 425193de48b8170f9d5aa9286d09f844
entity_id: 0f24bd890aeef5dab4612ba16f60d546
domain: binary_sensor
trigger: device
enabled: true
conditions:
- condition: sun
before: sunrise
after: sunset
actions:
- type: turn_off
device_id: 808a2e16c0822d249e70594b719fd9ad
entity_id: 300aecfb2ed930185b920a00f7d1a92e
domain: switch
- type: turn_off
device_id: 8bca12a8f6b5e6b63fa2ecb6bca19de9
entity_id: 47526887b8bcf25f44708b18dbe97b10
domain: switch
mode: single
Any help would be great, thanks!