diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2022-02-10 19:01:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 19:01:24 +0300 |
commit | a95e40d46c30f0a39fed4ace4b98569ae39c946c (patch) | |
tree | 332cc52565f30e497afa24cf484cf7b0e38fa104 /README.md | |
parent | d0ca8909df3d2059147802d510a03634629f8d62 (diff) |
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 70 |
1 files changed, 70 insertions, 0 deletions
@@ -36,6 +36,76 @@ sudo setcap 'cap_net_raw,cap_net_admin+eip' `which gatttool` * Tune rest of the settings if you want. * Enjoy. +## Hints + +You can use the [card_mod](https://github.com/thomasloven/lovelace-card-mod) integration to make the color of the card icon depend on the temperature of the kettle. + +Example: + +``` +type: vertical-stack +cards: + - type: button + tap_action: + action: more-info + entity: water_heater.skykettle_rk_g211 + show_state: true + name: Чайник + hold_action: + action: toggle + card_mod: + style: > + {% set temp = state_attr("water_heater.skykettle_rk_g211", + "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 %}; + } + - type: entities + entities: + - entity: water_heater.skykettle_rk_g211 + card_mod: + style: > + {% set temp = state_attr("water_heater.skykettle_rk_g211", + "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 %}; + } +``` + +![image](https://user-images.githubusercontent.com/4236181/153446401-45c2f09e-2637-4fd1-8dec-0c365a3babb5.png) + ## Donations * PayPal: [clusterrr@clusterrr.com](https://www.paypal.me/clusterm) |