I’ve created a custom device_tracker entity where I am using device_tracker.see
to change the state from home or not_home. It seems to work, but I am getting a warning.
warning:
Template loop detected while processing event: <Event state_changed[L]: entity_id=binary_sensor.shion_presence, old_state=<state binary_sensor.shion_presence=on; friendly_name=Shion, icon=mdi:home-outline, device_class=presence @ 2021-11-28T14:48:25.597592+09:00>, new_state=<state binary_sensor.shion_presence=off; friendly_name=Shion, icon=mdi:home-outline, device_class=presence @ 2021-11-28T15:00:27.598841+09:00>>, skipping template render for Template[{% if is_state('binary_sensor.shion_presence','on') %} mdi:home-account {% else %} mdi:home-outline {% endif %}]
automation:
- alias: Set tms Tile Location
trigger:
- platform: state
entity_id: binary_sensor.shion_presence
action:
- service: device_tracker.see
data:
dev_id: shion
location_name: "{{ 'home' if trigger.to_state.state == 'on' else 'not_home' }}"
gps_accuracy: 80
known_devices:
shion:
name: Shion
mac:
icon: mdi:crosshairs-gps
picture: /local/img/people/avatar-shion.png
track: true