Switch with REST, HTTP Post, control PoE Switch

Hey, im having problem setting up a on/off-switch for ports on my PoE Switch, it works fine with CURL with the following command:

curl -X POST -d 'method:setPoeProps&indexes=6&port=6&enabled=true' http://192.168.1.24/html/json.html

But when i try to use it in HASS i cant get it to work.

rest_command:
  my_request:
    url: http://192.168.1.24/html/json.html
    method: POST
    payload: '{"method:setPoeProps","indexes": "6","port": "6","enabled": "true"}'

How should i set up my switch?

Why did you change the payload to a dict?

shouldn’t you do it like this:

rest_command:
  my_request:
    url: http://192.168.1.24/html/json.html
    method: POST
    payload: 'method:setPoeProps&indexes=6&port=6&enabled=true'

Well yes that worked better :wink: thanks.