HI,
Please let me repost this Lovelace: Button card now that I am getting more acquainted with the Button card, and feeling the comfort of this card in Lovelace compared to that of the Tiles card. Not to mention the speed of development you tend to deploy…
Id really need the possibility to set entity_picture_templates. Ive carefully read the full documentation, but down think that is available right now, even with the latest templating addition? I know I can set picture in state, but that only allows for on/off/unavailabe.
In my particular need, and I can think of many other that require a picture based on other values than these 3, I need pictures based on the state of the zone a device is in.
My current template (for Tiles) is like this:
entities:
- entity: device_tracker.life360_name
templates:
background: >
if (state === 'home' || state === 'not_home') return 'url(\"/local/tiles/family/name_' + state + '.png\")';
return 'url(\"/local/tiles/family/name_' + entities['sensor.name_location_picture'].state + '.png\")';
style: >
if (state === 'home') return 'background-color: #008000';
if (state === 'not_home') return 'background-color: #808080';
return 'background-color: #643aac';
would you consider creating the option to allow js templates for entity_pictures? hoping that
entity_picture_template: >
if (entity.state === 'home' || entity.state === 'not_home') return 'url(\"/local/tiles/family/name_' + entity.state + '.png\")';
return 'url(\"/local/tiles/family/name_' + entities['sensor.name_location_picture'].state + '.png\")';
would be just as feasible as the label_template we made a few posts above
secondly: can we point the more-info to another entity than the button entity. Use case: with device trackers, we tend to have more than 1 per person, and collect these in a group. My specific setting above, Id want the button to have the entity of my life360 device tracker, but the more-info to open up the group.name which holds all device-trackers for that person. Could be anything really, but in this case really very useful information is revealed.
Thanks for having a look!