Hi there! I am trying to get a button working that shows the state of my ikea door sensor. I have managed to do the following:
type: custom:button-card
entity: binary_sensor.ikea_window_sensor_1_offnung
icon: none
show_name: false
styles:
card:
- color: white
state:
- styles:
card:
- color: >
[[[
return states['binary_sensor.ikea_window_sensor_1_offnung'].state === 'open' ? 'red' : 'green';
]]]
This does not seem to work though, the button is just grey.
Thanks for help!