Bug in sensor templating?

The top instance is the value templated sensor. below that are the two device tracker instances:

sensors.yaml entry (Note: for testing, I replaced the value of ‘off’ with ‘WTF’):

#
# Sensor Value Templating
#
sensor 8:
  platform: template
  sensors:
    device_tracker.epson3e7694fiosrouterhome:
      value_template: '{% if is_state('device_tracker.epson3e7694fiosrouterhome', 'home') %}on{% else %}WTF{% endif %}'
    device_tracker.19216819:
      value_template: '{% if is_state('device_tracker.19216819', 'home') %}on{% else %}WTF{% endif %}'

How the hell can this be showing up as “off” if that isn’t even a valid value??? The correct state should be either “on” or “WTF”. And why isn’t the other value template sensor ever even created? It’s not that it’s missing from the group; it doesn’t even show in the entities list. And no matter what I do, the state never changes from Off!

As a start, name your sensors something that doesn’t conflict with an existing entity. Like:

sensor 8:
  platform: template
  sensors:
    some_other_name_here:
      value_template: '{% if is_state('device_tracker.epson3e7694fiosrouterhome', 'home') %}on{% else %}WTF{% endif %}'

I figured it out and it will no doubt give you a chuckle…

I had originally started exactly as you recommended, with another name and it got changed becuase I kept getting errors in the example that was given to me by a dev here. Because I figured this dev had to know what he was doing, I as a newb surely must be doing something wrong. Turned out that the example given to me as:

value_template: '{% if is_state('device_tracker.epson3e7694fiosrouterhome', 'home') %}on{% else %}WTF{% endif %}'

should actually be:

value_template: "{% if is_state('device_tracker.epson3e7694fiosrouterhome', 'home') %}on{% else %}WTF{% endif %}"

Note the double quotes on the beginning and end of the value template. Changing this, along with changing back to my original names, solved the issue.

Dev who gave me the example? balloob. I thought for sure it had to be me doing something wrong so I tested every possible change without seeing what the error was in the first place.

Thanks very much for your help with this! Once I went back to my original names, the configuration error came back and I was able to focus on that. Much appreciated!