Hi, I have some Bosch heating controls added to my HA implementation. What I want to acchieve is: When someone selects a target temperature that is higher than for example 23°C, it should change the target temp. back to 23°C. What I currently have is:
Are you using heat-cool mode? IIRC, the target_temp_high and target_temp_low attributes are only used for heat-cool mode, if you are using a standard cool mode the attribute you should be monitioring with your trigger is temperature.
If you are using heat-cool mode then you should not be using/setting the temperature variable.
The problem is, that at the apartment the users can control the temp. by using the Bosch device that is mounted there. I can’t set a max number on that Bosch devices. But what I can do is, to check on HA if the temp. that has been set is exeeding a defined value and if it is, to set the value to a lower value.
Therefore I have to check by trigger if the target temp has been changed. If so, I have to check wether it is within a defined range. If not, decrease the value.
You are trying to set values that are not usable in your situation.
In your automation action you try to set the target_temp_high and target_temp_low values… which will crash your automation in this case. Those two values are only applicable to climate devices that are using the heat_cool mode.
So your automation should look more like:
- id: '1606197808151'
alias: KG2 Temperature above limit
trigger:
- above: 20
entity_id: climate.wohnzimmer_kg2
attribute: temperature
platform: numeric_state
for: "00:00:01"
action:
- service: climate.set_temperature
target:
entity_id:
- climate.wohnzimmer_kg2
data:
hvac_mode: auto
temperature: 18
mode: single
Keep in mind that State triggers require the state to change to make this automation run. If the temperature setting is already above 20 when you update the automation, it will not trigger unless the temperature setting is changed to below 20 then above 20… there are methods available to make automations more resilient.
You may want to extend the for: value of the trigger. Defining a for: value can help “debounce” a trigger so that there’s no need to use a parallel or queued mode. In your case it might also help because the person physically changing the temperature setting will walk away from the thermostat…
A little advice here.
Place a delay first in the actions of 30 seconds or something.
That way the temperature csn be set to 30 degrees but when they stop looking it’s set down to 23 or what your number was.
This will make them not realize it and not try and fight it.