Hi
Given the following sensors that detect the temperature:
sensor.living_room_temperature
sensor.chamber_temperature
sesnor.kitchen_temperature
and the following generic_thermostat
- platform: generic_thermostat
name: Riscaldamento termosifoni
heater: switch.rele_caldaia
target_sensor: input_select.my_selection
min_temp: 15
max_temp: 30
Is it possible to have a dynamic target_sensor, assigning it with an input_select where the sensors are those listed above?
pedolsky
(Pedolsky)
November 24, 2022, 9:29am
3
Create an input select helper with your temperature entity ids and use its state as described in the former topic .
input_select:
thermostat_target:
name: Thermostat Target
options:
- sensor.one_temperature
- sensor.two_temperature
- sensor.three_temperature
tom_l
November 24, 2022, 9:59am
4
You cant use that in the generic thermostat configuration. Unless I am mistaken.
pedolsky
(Pedolsky)
November 24, 2022, 10:07am
5
I tested it and it is working. What are your concerns?
tom_l
November 24, 2022, 10:09am
6
My concern was that the entity would be set when home assistant loaded the integration at start up and would then be unable to be changed during runtime.
pedolsky
(Pedolsky)
November 24, 2022, 10:12am
7
Might be a caveat*, donāt know. But this is a bit different to āis not possibleā.
P.S.: *in regard to the use in automations. But then I would use a start delay.
forschi
November 24, 2022, 10:15am
8
I solved this with a input select and a template sensor.
the input select is used to select what sensor the thermostat will use (Internal room, floor sensor or external HUE-sensor)
sensor:
- platform: template
sensors:
bedroom1_climate_control_sensor:
value_template: >-
{% if is_state('input_select.bedroom1_climate_control_sensor','GulvfĆøler') %}
{{ states('sensor.bedroom1_thermostat_floor_tempeature')|float(18) }}
{% elif is_state('input_select.bedroom1_climate_control_sensor','RomfĆøler') %}
{{ states('sensor.bedroom1_thermostat_room_tempeature')|float(15) }}
{% elif is_state('input_select.bedroom1_climate_control_sensor','HUE-sensor') %}
{{ states('sensor.pir_bedroom1_temperature_15m')|float(15) }}
{% else %}'N/A'
{% endif %}
climate:
- platform: generic_thermostat
name: "Soverom1"
heater: input_boolean.bedroom1_heating
target_sensor: sensor.bedroom1_climate_control_sensor
target_temp_step: 0.5
max_temp: 20
min_temp: 15
hot_tolerance: 0.5
cold_tolerance: 0.5
comfort_temp: 18
activity_temp: 18
home_temp: 18
sleep_temp: 18
away_temp: 18
2 Likes
pedolsky
(Pedolsky)
November 24, 2022, 10:24am
9
I donāt know how to handle different float defaults, otherwise you can shorten it a bit:
template:
- sensor:
- name: Thermostat Target
unique_id: thermostat_target_202211232124
icon: mdi:fire
state: |-
{% set target = states('input_select.thermostat_target') %}
{{ states(target)|float(22) }}
Or prettified:
input_select:
thermostat_target_prettified:
name: Thermostat Target
options:
- Loggia
- Eingang
- KĆ¼che
template:
- sensor:
- name: Thermostat Target prettified
unique_id: thermostat_target_prettified_202211232124
icon: mdi:fire
state: |-
{% set target = states('input_select.thermostat_target_prettified')
|replace('Loggia', 'sensor.loggia_temperature')
|replace('Eingang', 'sensor.eingang_temperature')
|replace('KĆ¼che', 'sensor.kuche_temperature')
%}
{{ states(target)|float(22) }}
2 Likes
Thank you all, you have been very kind.
I adopted Pedolskyās āprettifiedā solution but Iām sure Froschiās solution would have been fine too
Thanks again