HI,
on https://github.com/andrey-git/home-assistant-custom-ui/blob/master/docs/templates.md#change-on-state-to-activated @andrey instruction for templating the binary_sensor state display are as follows:
binary_sensor.motion_sensor:
templates:
# null will make the regular state-based logic to run.
_stateDisplay: if (state === ‘on’) return ‘activated’; else return null;
Is it also possible to show the value of another template?
I am trying to have it show the number of people home and show the value of the badge that has that number:
binary_sensor.grand_family_home:
show_last_changed: true
templates:
icon_color: >
if (state === 'on') return 'rgb(251, 210, 41)';
return 'rgb(54, 95, 140)';
_stateDisplay: >
return {{states.sensor.home_badge.state}}
Unfortunately the sensor just shows Detected, as device_class Occupancy , which i have given it indeed because of the nice little icon:
the badge is :
leaving the device_class out and manually templating the icon works fine for the icon, but the state wont be displayed as desired: