Hello everyone,
I need some help to customize a lovelace card. For context:
I am using a binary card, that indicates if a window is open or closed. I am using the lovelace-minimalist-ui theme.
This is what it currently looks like:
The yaml for this card looks like this:
- type: 'custom:button-card'
template: card_binary_sensor
variables:
ulm_card_binary_sensor_alert: true
ulm_card_binary_sensor_name: 'Bathroom Window'
ulm_card_binary_sensor_icon: 'mdi:window-open'
entity: binary_sensor.zigbee_sensor_bathroom_window_contact
It is also possible to show the last change, by setting
ulm_card_binary_sensor_show_last_changed: true
This changes the value to something like “10 minutes ago”. However, it only shows either the open/close state or the last change state.
My questions:
1) I want to show both: the open/close state and the last change state.
How can I do that?
I assume I somehow need to template this, but I don’t really know how I can do that.
2) Is there a way to change the icon, based on the state? I want the icon to be mdi:window-open
when the state is open, and mdi:close
when the state is closed.