You need to use three backticks in one line before and after the code you want to post.
It’s not, that we don’t want to help, it’s because indentation is very important in YAML, and without the formatting these indentations get lost. It could be, that your code has some indentation errors, we just couldn’t see it, but it could also be everything perfectly ok, and we as well can’t see it.
Take a look at the explanation here:
But besides that, I don’t get what you mean. The automation you show, seems to do what it should. The device_tracker changes it’s state to something else than “0”, the automation starts, and the switch is turned on.
But I have a guess, what it could be. Not “0” isn’t automatically “1”. It can also be “unavailable” or “unknown” - everything but not “0”.
Hi Paddy0174,
I did use the three backticks, it didn’t do anything. I tried the button “preformatted text” as well. Same result. I don’t get this. In earlier posts it did work.
Anyway: I want an automation which locks the frontdoor when everybody is away (gps). “rico” wasn’t home and still I saw in the logfile that his state was changed. Sometimes the frontdoor locks while somebody is still at home. That’s the point I don’t understand.
Somebody told me I have to use “0” for counting how many persons are at home. Do you have a suggestion to get it working?