I have a couple of automations, all working off Ubiquiti presence.
I know the presence is working because I can see the entries in the logbook.
eg; bob away, bob home
However the automations are not being triggered or at least they don’t appear to be.
Not all of them appear in the logbook, so don’t.
Is this because they are executing but not being logged?
Or are they not executing? They do not show as triggered.
It seems to be on entities where I have changed the default name?
For example, here is one.
All of these worked before 0.97
Now (already on 0.97.2) some of them work and some of them don’t.
It might be that the ones that don’t work have an entity_id that has been edited?
Can’t see anyway to log or debug
- id: '1546875248854'
alias: Bob Home
trigger:
- entity_id: device_tracker.bob_iphone
from: away
platform: state
to: home
condition: []
action:
- data:
event: came_home
service: ifttt.trigger
- data: {}
service: shell_command.bob_home
I finally sorted it out!! Yeah.
In case it helps others, here are the clues:
First turn on all logging in configuration.yaml
logger:
default: notset
Then watch the homeassistant.log. Very verbose but that’s what I needed.
The problem was the automation (see above example) was expecting a state of “away” but the UniFi integration doesn’t use away, it uses ‘not_home’ and this was the issue.
I actually deleted “away” in all automations and left it blank!
eg:
- id: '1546875248854'
alias: Bob Home
trigger:
- entity_id: device_tracker.bob_iphone
platform: state
to: home
- id: '1546866523509'
alias: Bob Away
trigger:
- entity_id: device_tracker.bob_iphone
from: home
platform: state
So you either go TO or FROMhome and I don’t care what your other state is or was.
I would be surprised if that was the cause since I thought all device_trackers have always used home & not_home as the state. I don’t see why the unifi component should have been different.
@finity You might be correct, however when I removed “away” from my automations everything worked again. It was in the automations.yaml and when I removed it, all was good.
Whether it was the “cause” or not I am not sure, but the solution was to remove it!