Skip to content

Instantly share code, notes, and snippets.

@kai-zer-ru
Last active February 8, 2024 03:42
Show Gist options
  • Save kai-zer-ru/231407f2b63b26f2e61b4d1fa9a566d2 to your computer and use it in GitHub Desktop.
Save kai-zer-ru/231407f2b63b26f2e61b4d1fa9a566d2 to your computer and use it in GitHub Desktop.
Чайник
type: custom:stack-in-card
cards:
- type: markdown
content: |
<center><h2>Чайник
- type: entities
entities:
- entity: light.skykettle_rk_m216s_light
name: Подсветка
- entity: water_heater.skykettle_rk_m216s
name: Статус
- entity: switch.skykettle_rk_m216s
name: Включение
- entity: sensor.skykettle_rk_m216s_total_energy_consumed
name: Потребляемая мощность
- entity: switch.skykettle_rk_m216s_enable_boil_light
name: Свет при кипячении
- entity: switch.skykettle_rk_m216s_enable_sound
name: Звук
show_header_toggle: false
- type: custom:button-card
tap_action:
action: more-info
entity: water_heater.skykettle_rk_m216s
show_state: true
name: Чайник
hold_action:
action: toggle
card_mod:
style: >
{% set temp = state_attr("water_heater.skykettle_rk_m216s",
"current_temperature") %} :host {
--card-mod-icon:
{% if temp != None and temp > 95 %}
mdi:kettle-steam;
{% else %}
mdi:kettle;
{% endif %}
--card-mod-icon-color:
{% if temp != None -%}
hsl(
{{ 235 + (0 - 235) / (95 - 25) * (temp - 25) }},
{{ 60 + (100 - 60) / (100 - 25) * (temp - 25) }}%,
50%
)
{%- else -%}
black
{%- endif %};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment