Condition switch that does nothing

Hi,
Is there a way to make a switch that does nothing? I just wan’t to assign a switch to each of my home temp sensors, so I can use the state of the switch as a condition to choose which sensor controls my central heating.

I could probably use GPIO’s that are not in use but I don’t really want to use the rpi_gpio platform if there’s a better alternative.

Any other suggestions are welcome, I’m very new to all this.

What you need is an input_boolean

Thanks for the suggestion. I did look at input_boolean, as a way of setting up some conditions for the automatiuon, but I can’t see how I can use this to select a specific sensor that will be used for the trigger. It would appear that I’d still need some switches assigned to the sensors for this to work?

Create an input_boolean for each of your temp senors, name it, for example, “primary sensor” with an additional location description like “primary sensor livingroom”.
Make them “off” by default (maybe except for one “default primary sensor”).
Create an automation that turns off all the other “primary sensor” switches as soon as one is switched on.

Then, in your central heating automation, simply check which sensor has its accompanying “primary sensor” switch turned on and use that one’s value.

Sebastian

I’ll give it a go. Thanks very much for your help sebk-666 and gpbenton!!

I’ve got the code working! So this next query is not really necessary but I’d really like to streamline things, just in case I plan to do something similar in the future.

I’ve copied the code from my config file below. Is there a better way to write this?

# automation to make sure only one temp sensor is used for central heating
automation:
  - alias: select_l
    trigger:
      - platform: state
        entity_id: input_boolean.select_livingroom_sensor
        from: 'off'
        to: 'on'
    action:
      service: homeassistant.turn_off
      entity_id:
        - input_boolean.select_hallway_sensor
        - input_boolean.select_bedroom_sensor
        - input_boolean.select_isabels_room
        - input_boolean.select_rowans_room
  - alias: select_h
    trigger:
      - platform: state
        entity_id: input_boolean.select_hallway_sensor
        from: 'off'
        to: 'on'
    action:
      service: homeassistant.turn_off
      entity_id:
        - input_boolean.select_livingroom_sensor
        - input_boolean.select_bedroom_sensor
        - input_boolean.select_isabels_room
        - input_boolean.select_rowans_room
  - alias: select_b
    trigger:
      - platform: state
        entity_id: input_boolean.select_bedroom_sensor
        from: 'off'
        to: 'on'
    action:
      service: homeassistant.turn_off
      entity_id:
        - input_boolean.select_hallway_sensor
        - input_boolean.select_livingroom_sensor
        - input_boolean.select_isabels_room
        - input_boolean.select_rowans_room
  - alias: select_i
    trigger:
      - platform: state
        entity_id: input_boolean.select_isabels_room
        from: 'off'
        to: 'on'
    action:
      service: homeassistant.turn_off
      entity_id:
        - input_boolean.select_hallway_sensor
        - input_boolean.select_bedroom_sensor
        - input_boolean.select_livingroom_sensor
        - input_boolean.select_rowans_room
  - alias: select_r
    trigger:
      - platform: state
        entity_id: input_boolean.select_rowans_room
        from: 'off'
        to: 'on'
    action:
      service: homeassistant.turn_off
      entity_id:
        - input_boolean.select_hallway_sensor
        - input_boolean.select_bedroom_sensor
        - input_boolean.select_isabels_room
        - input_boolean.select_livingroom_sensor

set parameters of controlling sensor

  - alias: control_l
    trigger:
      - platform: numeric_state
        entity_id: sensor.living_room
        above: 19
        below: 17
    condition:
      - condition: state
        entity_id: input_boolean.select_livingroom_sensor
        state: 'on'
    action:
      service: script.turn_on
      entity_id: script.chswitch_script
  - alias: control_h
    trigger:
      - platform: numeric_state
        entity_id: sensor.hallway
        above: 19
        below: 17
    condition:
      - condition: state
        entity_id: input_boolean.select_hallway_sensor
        state: 'on'
    action:
      service: script.turn_on
      entity_id: script.chswitch_script
  - alias: control_b
    trigger:
      - platform: numeric_state
        entity_id: sensor.bedroom
        above: 19
        below: 17
    condition:
      - condition: state
        entity_id: input_boolean.select_bedroom_sensor
        state: 'on'
    action:
      service: script.turn_on
      entity_id: script.chswitch_script
  - alias: control_i
    trigger:
      - platform: numeric_state
        entity_id: sensor.isabels_room
        above: 19
        below: 17
    condition:
      - condition: state
        entity_id: input_boolean.select_isabels_room
        state: 'on'
    action:
      service: script.turn_on
      entity_id: script.chswitch_script
  - alias: control_r
    trigger:
      - platform: numeric_state
        entity_id: sensor.rowans_room
        above: 19
        below: 17
    condition:
      - condition: state
        entity_id: input_boolean.select_rowans_room
        state: 'on'
    action:
      service: script.turn_on
      entity_id: script.chswitch_script

# script to toggle central heating switches
script:
  chswitch_script:
    alias: Central Heating
    sequence:
      - service: switch.turn_on
        entity_id: switch.ch_switch
      - delay: 00:00:01
      - service: switch.turn_off
        entity_id: switch.ch_switch
  hwswitch_script:
    alias: Hot Water
    sequence:
      - service: switch.turn_on
        entity_id: switch.hw_switch
      - delay: 00:00:01
      - service: switch.turn_off
        entity_id: switch.hw_switch

I got ahead of myself here, the trigger isn’t working.

Do you need the ‘-’ on each instance of ‘trigger’, ‘condition’, etc? Should I basically use ‘-’ every time there’s a duplicate?