Rest API and Input Slider

hey guys. thanks for trying to help.
im controlling my AC using recorded IR commands through broadlionk rm mini and Input Slider component the value are from 15 to 31 each step in 1. each value starts a command shell script which send the recorded IR commands to the AC. so far all good and everything is working just fine.

im trying to control the slider using REST API.
here is the comands im using

curl -X POST -H “x-ha-access: MYPASS” -H “Content-Type: application/json” -d ‘{“state”: “22.0”}’ https://URL/api/states/input_slider.slider_1

this triggers the shell script successfully, BUT after every event the HASS GUI gets funny and im not more able to control the input slider using the GUI.
(picture attached)

how can i solve this issue?
Thank you all!

Stab in the dark, but I think you are sending it a string instead of a value, try:

-d '{"state": 22.0}'

thanks for the quick reply, i didnt mention but the command did work, its just that the HASS GUI got stuck. but i am ablie to send more commands using the CLI

hey aimc, i did tried your solution but the problem persists

No worries - I was thinking maybe the GUI cares about the string vs the value but the actual command doesn’t. Like I said, just a quick guess :slight_smile:

1 Like

hey guys. problem solved, seems like i forgot to add the attributes
here is the right way doing it
curl -X POST -H "x-ha-access: Password" -H "Content-Type: application/json" -d '{"state": '21.0', "attributes":{"min": 16, "step": 1, "friendly_name": "Bedroom AC Temp", "max": 30}}' https://MyDomain/api/states/input_slider.slider_1