Skip to content

HA Custom Card by @janvkem

Sam Reed edited this page Dec 17, 2023 · 3 revisions

Lovelace ramses_cc example

  1. You first need to install following lovelace modules. The easiest method is using HACS
  1. In a second step, you should create one input_number as slider and one input_text using either helper or configuration.yaml.

The same slider and toggle are used for all thermostats.

  input_number:
    min: 15.0
    max: 720.0
    name: ramses_duration_slider
    icon: mdi:timer
    step: 15.0
    unit_of_measurement: minutes
    mode: slider
    #id: ramses_duration_slider (I think using configuration.yaml it cannot be set, only using helper)

  input_text:
    name: ramses_preset_mode
    icon: mdi:radiator
    min: 0
    max: 20
    mode: text
    #id: ramses_preset_mode (Again, I believe that entity_id can only be set using helper)
  1. Create the first script for permanently changing the temperature.

This script is only executed if you selected permanent preset_mode. The temporary script is also called but will only be executed if the temporary preset_mode has been selected.

This step is necessary, because the data_value duration can only be set in the temporary preset_mode.

Be careful to change the entity_ids of input_text according to your setting.

 alias: Ramses simple thermostat
 sequence:
  - service: script.ramses_simple_thermostat_temporary
    data:
      entity_id: '{{entity_id}}'
      temperature: '{{temperature }}'
  - condition: template
    value_template: '{{states(''input_text.ramses_preset_mode'') ==''permanent'' }}'
  - service: ramses_cc.set_zone_mode
    data:
      entity_id: '{{entity_id}}'
      setpoint: '{{temperature }}'
      mode: |-
        {% if states('input_text.ramses_preset_mode') =='permanent'  %}
          permanent_override
        {% else %}
          temporary_override
        {% endif %}
 mode: single
  1. Create the second script for the temporary preset_mode.

Be careful to change the entity_ids of input_number (slider) and input_text according to your setting.

 alias: Ramses simple thermostat temporary
 sequence:
  - condition: template
    value_template: '{{states(''input_text.ramses_preset_mode'') ==''temporary'' }}'
  - service: ramses_cc.set_zone_mode
    data:
      entity_id: '{{entity_id}}'
      setpoint: '{{temperature }}'
      mode: temporary_override
      duration: '{{states(''input_number.ramses_duration_slider'') | int}}'
 mode: single
  1. Create the lovelace cards for each thermostat.

Replace xxxxx in climate.xxxxx with the entity_id of your thermostat.

There are 4 locations to change xxxxx with the id of the thermostat.

Be careful to change the entity_ids of input_number (slider), input_text and both scripts according to your setting.

You can also change the entity_id in order to show the battery level and the heat demand of the thermostat. (In this script it is called binary_sensor.04_yyyyy_battery and sensor.04_yyyyy_heat_demand.)

 type: vertical-stack
 cards:
  - type: 'custom:simple-thermostat'
    entity: climate.**xxxxx**
    header:
      name: xxxxxxx
    sensors:
      - entity: binary_sensor.04_yyyyy_battery
      - entity: sensor.04_yyyyy_heat_demand
    service:
      domain: script
      service: ramses_simple_thermostat
    control:
      - hvac: false
      - preset: false
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        color: '#dff4fd'
        color_type: card
        icon: 'mdi:cancel'
        name: Cancel override
        entity: input_text.ramses_preset_mode
        state:
          - operator: template
            value: >-
              [[[ return ((states['climate.**xxxxx**'].attributes.preset_mode ==
              'permanent') || (states['climate.**xxxxx**'].attributes.preset_mode
              == 'temporary')) ]]]
            color: '#03a9f4'
            styles:
              icon:
                - color: white
              name:
                - color: white
        tap_action:
          action: call-service
          service: ramses_cc.reset_zone_mode
          service_data:
            entity_id: climate.**xxxxx**
        styles:
          card:
            - height: 60px
            - border-radius: 4px
            - color: '#03a9f4'
          name:
            - font-size: 14px
            - padding-bottom: 3px
      - type: 'custom:button-card'
        color: '#dff4fd'
        color_type: card
        icon: 'mdi:timer-off-outline'
        name: Permanently override
        entity: input_text.ramses_preset_mode
        state:
          - value: permanent
            color: '#03a9f4'
            styles:
              icon:
                - color: white
              name:
                - color: white
        tap_action:
          action: call-service
          service: input_text.set_value
          service_data:
            entity_id: input_text.ramses_preset_mode
            value: permanent
        styles:
          card:
            - height: 60px
            - border-radius: 4px
            - color: '#03a9f4'
          name:
            - font-size: 14px
            - padding-bottom: 3px
      - type: 'custom:button-card'
        color: '#dff4fd'
        color_type: card
        icon: 'mdi:timer-outline'
        name: Temporarily override
        entity: input_text.ramses_preset_mode
        state:
          - value: temporary
            color: '#03a9f4'
            styles:
              icon:
                - color: white
              name:
                - color: white
        tap_action:
          action: call-service
          service: input_text.set_value
          service_data:
            entity_id: input_text.ramses_preset_mode
            value: temporary
        styles:
          card:
            - height: 60px
            - border-radius: 4px
            - color: '#03a9f4'
          name:
            - font-size: 14px
            - padding-bottom: 3px
  - type: 'custom:slider-entity-row'
    name: Duration
    entity: input_number.ramses_duration_slider