I want control my AC using Broadlink. What I want to do is when I move the slider, the HA sends to Broadlink the IR code for that temperature.
I have the switches from Broadlink and the scripts.
My configuration.yaml
#Input number
input_number:
target_temp:
name: Temperatura
min: 18
max: 25
step: 1
unit_of_measurement: ºC
icon: mdi:target
On automations.yaml, I wrote this, but I’m getting an error:
I put one switch to turn my ac on and off, but when I turn it on, the temperature is send on IR code, so my question is: Can the switch read the slider, and send the slider’s temperature to the broadlink?
First, you shouldn’t use #ERRO as your else statement because you are sending nothing to packet when getting to that branch. # indicates comment which means the line will be ignored. You should supply it with the word error.
Second, you are placing a data_template inside the data section. You need to place it inside a data_template section. Templates always need to go in template sections:
If you want to make a switch that sends a temperature when it turns on, you can use a template switch or tie a input_boolean to a turn on / turn off automation. Personally I recommend template switch because everything is together as a package. The only downside to template switch is that you would need to read a state from something. If you plan to use the switch to track the on/off state, you’d want to use input_boolean.