We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi guys!
I have the following sensor / card in my filters:
filter: include: - entity_id: sensor.kochfeld_powerstate options: type: "custom:button-card" template: card_input_boolean custom_fields: item1: card: custom_fields: item1: card: styles: icon: - color: > [[[ if (entity.state == 'An'){ return 'rgba(var(--color-blue),1)'; } return 'rgba(var(--color-theme),0.2)'; ]]] img_cell: - background-color: > [[[ var color = "blue"; if (entity.state == 'An'){ return 'rgba(var(--color-blue),0.2)'; } return 'rgba(var(--color-theme),0.05)'; ]]]
As the sensor is not a binary_sensor the img_cell and icon is always colored. So I add a custom style which checks the state of the entity id.
On a normal card outside auto-entities the config is working well, while I got the following error with auto-entities:
Does custom styles not working with auto-entities?
Thanks! Dominik
The text was updated successfully, but these errors were encountered:
Try using config.entity instead of entity. Ie. Either if (config.entity.state == 'An'){ or if (states(config.entity) == 'An'){
config.entity
entity
if (config.entity.state == 'An'){
if (states(config.entity) == 'An'){
Here is my auto-entities card for batteries where you can see I am using state: '{{ states(config.entity)|int(0) }}%'.:
state: '{{ states(config.entity)|int(0) }}%'
filter: include: - integration: battery_notes domain: sensor attributes: device_class: battery state: < 101 options: type: custom:template-entity-row entity: this.entity_id name: >- {{state_attr(config.entity,'friendly_name')}} ({{state_attr(config.entity,'battery_type_and_quantity')}}) secondary: >- Replaced: {{ state_attr(config.entity,'battery_last_replaced')|relative_time() }} ago state: '{{ states(config.entity)|int(0) }}%' hold_action: | { "action": "call-service", "service": "battery_notes.set_battery_replaced", "data": { "device_id": "{{ device_id(config.entity) }}", }, "confirmation": { "text": "Update Battery Replaced Date", }, }
Sorry, something went wrong.
No branches or pull requests
Hi guys!
I have the following sensor / card in my filters:
As the sensor is not a binary_sensor the img_cell and icon is always colored. So I add a custom style which checks the state of the entity id.
On a normal card outside auto-entities the config is working well, while I got the following error with auto-entities:
Does custom styles not working with auto-entities?
Thanks!
Dominik
The text was updated successfully, but these errors were encountered: