With the addition of custom domains to Nabu Case remote access (nice!), I thought I’d limit remote access to only when I am out of home, reducing the exposure of the service when I don’t need it.
Put this basic automation together which seems to work well. Replace “[your_id]” with the person you are tracking the location of.
alias: Nabu Casa - Remote Access
description: >-
Checks presense of [your_id], then if home disables remote access and if out,
enables it.
trigger:
- platform: state
entity_id:
- person.[your_id]
condition: []
action:
- if:
- condition: state
entity_id: person.[your_id]
state: not_home
then:
- service: cloud.remote_connect
data: {}
- service: logbook.log
data:
name: Nabu Casa
message: Remote Access Enabled
entity_id: automation.nabu_casa_remote_access
else:
- service: cloud.remote_disconnect
data: {}
- service: logbook.log
data:
name: Nabu Casa
message: Remote Access Disabled
entity_id: automation.nabu_casa_remote_access
mode: single