Help with zone based switch

Hi,
first of all, this is a really nice piece of SW - thanks for that.
I’m stuck in setting up an very basic automation and need some help.

Scenario is quite easy but for some reason it’s not working.
Help is really appreciated :wink:

Scenario:
I setup a command line switch which is firing if i trigger it manually.
Now I would like to switch them in dependency of my tracked phone:
At home: switch of
Not at home: switch on

Here are the relevant parts of my config:

device_tracker: platform: ddwrt host: 192.168.x.1 username: xxxxxx password: xxxxxx
(–> set friendly name to ToM in known devices)

[code]switch:
platform: command_line
switches:
teste:
oncmd: sudo /root/raspberry-remote/send 10000 2 1
offcmd: sudo /root/raspberry-remote/send 10000 2 0

automation:
trigger:
platform: state
entity_id: device_tracker.ToM
state: ‘not_home’
action:
service: teste.turn_on
entity_id: switch.teste[/code]

I tried it also with platform zone (and state change from home - not_home) with iCloud tracker: no success, too.

I had the same problem with the nmap component. My fix was to use the original name given to the device, for some reason the name change doesn’t carry over. You can look in the developer tools to find the name(not sure which tool, and I’m not home so I can’t check). Also you may need to give your automation a name or alias.

Awesome, it worked with the original name from known_devices :slight_smile:
Small cause great effect.
Does anyone know, is this desired behaviour or a bug?

Anyways: Thank you very much, crithon!