Skip to content

Custom-card "Water heater"

NOTE This card is under review and is not ready to use!

Credits

Author: tben - 2021 Version: 1.0.0

Changelog

1.0.0 Initial release

Usage


Requirements

This card needs the following to function correctly:

Component / card required Note

Variables

Variable Example Required Explanation

Template code

Template Code
custom_card_water_heater.yaml
---
card_water_heater:
  icon: "mdi:waves"
  tap_action:
    action: "more-info"
  hold_action:
    action: "more-info"
  label: >-
    [[[
        if (entity.state == 'off'){
          return 'Arrêt forcé';
        }else{
          if (states["sensor.shelly_prise_salon_conso"].state > 0){
            var etat = "Chauffe • " + states["sensor.shelly_prise_salon_conso"].state + "W";
          }else{
            var etat = "Inactif";
          }
          return etat ;
        }
    ]]]
  state:
    - operator: "template"
      value: >
        [[[
          return (states['sensor.shelly_prise_salon_conso'].state > 0)
        ]]]
      styles:
        icon:
          - color: "rgba(var(--color-red),1)"
        img_cell:
          - background-color: "rgba(var(--color-red),0.2)"
        card:
          - background-color: "rgba(var(--color-background-red),var(--opacity-bg))"
        name:
          - color: "rgba(var(--color-red-text),1)"
        label:
          - color: "rgba(var(--color-red-text),1)"

HomeAssistant

...

Example

...


Note

...