The need for duplication of entities for some basic stuff is bad. states "home/not_home" to "online/offline" without template sensor?

ok, so I guess it’s a recurring problem, I saw similar struggles on the forum. read those, tried to implement, failed. I’m feeling, that the lack of possibility to change default state names for some entities, lack of possibility to change default icon colors for active/inactive - is just STRANGE, and I’d love to see it change soon.

EDIT: I know that I can make template sensors, but it’s unnecessary duplication IMHO. having device trackers and using them for another sensors isn’t “in my style” and I’m leaving it as the last resort. the last last last resort :wink:

anyway, let’s get to the point.
I have device_tracker ping platform set up for almost every network device in my LAN. because I like to know if everything’s good with my stuff. as you probably guessed, the home/not_home states are ridiculous in that case, because those devices are always home, just sometimes they go offline.

after some digging I’ve installed latest CustomUI with the local option, and Customizer to have it all working with my Hassio 0.98.2 on Rpi3. all necessary stuff in configuration.yaml is added, mostly by copy-pasteing it from projects’ github pages.

because I use my “clever” naming conventions, all my ping device_tracker entities start with “png_”, so I added this to customize_glob:

"device_tracker.png_*":
  show_last_changed: True
  templates:
    icon_color: >
      # default blue color when inactive, yellow when active
      if (state === 'home') return rgb(255, 212, 85);
      return 'rgb(60, 118, 155)';
    state: >
      if (state === 'home') return 'online';
      return 'offline';

configuration seems to be ok [config validation isn’t showing any problems, and also the template part is added to entity’s attributes, what can be checked/seen in the developer tools/states tab] but that’s all I’m getting. color isn’t changing while active, state name isn’t changing to my definitions.

did I missed something?

FWIW, if you use ping binary_sensor (as opposed to device_tracker), it uses the connectivity device_class. Therefore the entity’s states will be reported as ‘Connected/Disconnected’.

Screenshot%20from%202019-09-02%2018-22-24

It’s not your preferred online/offline but definitely more appropriate, in this context (network equipment), than device_tracker’s home/not_home.

yes, it solves half of the problem. I mean - sure, I can exchange home to connected [instead of shorter one - online], but what about colors? or even icons changeable according to state?
I guess I wrote my question too fast, but also didn’t wanted to make it any longer, but there are two main problems on my side:

  1. lack of ability to control state names/icon colors by default settings
  2. problems with customizer not running [and that would solve all once and for all I guess]

so sure, I’m aware of and I’m thinking about the ping binary_sensor, but it’s less convenient to config, even less than device tracker [and also I would have to change quite a bit of my yaml files to use that] so was hoping to avoid that somehow :frowning:

nonetheless, I’ll keep that in mind, thanks.