I have an A/C solution that I set the state and temperature using HTTP calls.
Currently I operate it using command line switch, with curl.
I try to use an input number as the selector of chosen temp, and bind the value in the command line switch, for instance:
Try to cast it to string:
Command failed: /usr/bin/curl -X POST https://10.0.0.8/temp/Work-room/{{ states.input_number.guest_room_temp_slider.state | string }}/high
I think you need to pass variables to shell command through a script. I searched the forum and found this which I think you can create a script to set temp.
Yes command_state: "/usr/bin/curl -X GET https://10.0.0.8:8080/temp/Work-room"
where the value is a json which I check with value_template: '{{ value_json.damper == "high" }}'
switch:
- platform: template
switches:
guest_room_climate_set_by_slider:
value_template: "{{ is_state('sensor.guest_room_climate', 'on') }}"
turn_on:
service: script.guest_room_climate
turn_off:
service: script.??? (You need to define another shell command and another script or pass parameters to a script)
Wow, Thanks!
Its sure is a progress.
Only thing annoying is that when using a command line switch, it takes a sample of the state right after toggling it, so it immediately shows it as on or off.
When using the template, there is a delay of up to a minute until the sensor is taking a sample again.
Is there a way to force sample of the sensor? so it will be more “synced”?