Hi all, I would like to be able to set the temperature of my heater via the rest api of my heater.
What I can currently do is set the temperature via a curl -X POST and read and display it via Home Assistant.
I now want to create a temperature slider in Home Assistant that I can use to set the temperature via the rest api.
However, despite a lot of research, I have not been able to get it implemented.
Can you help me here?
thanks already Flame4ever
Set command of the Rest api (to 21 °C): curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' -i 'http://192.168.1.201/set/json/v1/1/soll/10/' --data 'user=XXX&password=XXX&set=21.00'
Hello @tom_l, the article was very helpful, but how do I get my user and password into the call, does it have to be in the payload, as far as I understand there is no “data” in rest_command.
attached my current configuration.
set_hobbyzimmer_temperature:
name: Set Hobbyzimmer Temperature
min: 25
max: 35 # or whatever the min and max are
step: 0.1
unit_of_measurement: "°C"
icon: mdi:thermometer
rest_command:
spa_set_temperature:
url: "http://192.168.1.201/set/json/v1/1/soll/11/"
method: POST
headers:
Content-Type: application/x-www-form-urlencoded
data:
user:[email protected]
password:XXX
payload: '{"soll": }'
sensor.controme_hobbyzimmer_solltemperatur is a functional sensor which returns the setpoint with the same API.
#configuration.yaml:
rest_command:
set_hobbyzimmer_temperature:
url: "http://192.168.1.201/set/json/v1/1/soll/11/"
method: POST
headers:
content-type: application/x-www-form-urlencoded
username: [email protected]
password: xxxxx
payload: '{"soll": {{ states("input_number.set_hobbyzimmer_temperature")| round(2) }} }'
set_hobbyzimmer_temperature:
name: Set Hobbyzimmer Temperature
min: 16
max: 35 # or whatever the min and max are
step: 0.1
unit_of_measurement: "°C"
icon: mdi:thermometer
The rest query does not work for my API, because it does not authenticate itself with the standard http header (username, password) but the information must be provided in the body.
Attached is the documentation of the API:
set methods
The /set/ calls have POST as HTTP method. The POST data must always contain "user" and "password" with your login data. Since we don't have certificates installed on the miniserver, it would make sense to send /set/ calls only on the local network. If the user cannot be authenticated, a status code 403 will be returned.
set-soll
+ /set/.../set/[RAUMID]/
Sets the setpoint temperature in the room. POST also contains "shall" with a decimal number as the value.
URL:
.../set/json/v1/1/soll/3/
Method:
POST
Body:
user
password
shall
Is there a possibility to include a body in the rest-command?
thx for helping me
Hello together, the following has now worked, but unfortunately only a fixed value (21.00 °C) is possible, how do I get a variable temperature (input_number) inserted here now?
Did you resolve your problems?
I’m trying to use my controme system into ha, reading out the Ist-Temperature is no problem, i’m searching for a solution to send the Soll-Temperature back to controme with the post command.