Number helper for heating controls

Hi,

I currently have an automation that sets heating to a specific level at certain times of the day, with the setpoint currently done within the automation itself by means of a simple “call service” command. What i want to do is add a number input boolean to the UI so the user can adjust the setpoint. This is my code:

alias: HC LR Afternoon Off
description: ''
trigger:
  - platform: time
    at: input_datetime.hc_lr_afternoon_off
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.hc_status
        state: 'on'
      - condition: and
        conditions:
          - condition: state
            entity_id: input_boolean.hc_disable_afternoon
            state: 'off'
          - condition: and
            conditions:
              - condition: time
                weekday:
                  - mon
                  - tue
                  - wed
                  - thu
                  - fri
                  - sat
                  - sun
action:
  - service: climate.set_temperature
    data:
      temperature: 16
    entity_id: climate.living_room
  - service: climate.set_temperature
    data:
      temperature: 16
    entity_id: climate.kitchen
mode: single

What i want to do set for example is set “climate.kitchen” to the value set into the “number” boolean, so that the user can choose the setpoint they prefer.

Thanks :slight_smile:

Conditions are and by default, what you’ve done does nothing :wink: Oh, and it’s not even a valid format for and anyway. Well, that and your time condition isn’t doing anything for you…

  - condition: state
     entity_id: input_boolean.hc_status
    state: 'on'
  - condition: state
    entity_id: input_boolean.hc_disable_afternoon
    state: 'off'

That’s all you need for those two.

For the final bit you use templating:

  - service: climate.set_temperature
    data:
      temperature: "{{ states('input_number.setpoint') }}"
    entity_id: climate.living_room
  - service: climate.set_temperature
    data:
      temperature: "{{ states('input_number.setpoint') }}"
    entity_id: climate.kitchen

even then you can simplify it further:

  - service: climate.set_temperature
    data:
      temperature: "{{ states('input_number.setpoint') }}"
      entity_id:
        - climate.living_room
        - climate.kitchen
5 Likes

Thanks for this. I will give it a go.

To clarify, the condition I have already works as it is, correct? However I have added in additional “and” statements where they are not required, correct?

Thanks.

This worked a treat!

I changed all my conditions too.

Thanks a million!