RESTful help

HI been trying to understand how the RESTful switch works as I am quite new to this.
I have successfully done the below

- platform: rest
  resource: http://ipaddress/api/callAction?deviceID=236&name=turnOn
  name: Test Light
  username: username
  password: password

This turn on the light - great, but
The switch in the interface is more like a momentary switch, also the light turns on ok.
But if I manually turn it off it comes on again in approx 30 secs
Ideally I need to make this into an on off switch
with for on
and for off
Would appreciate any help


I’m no expert but don’t you need to supply an on and off command?

Also to aid in debugging please format your code as explained in the blue banner at the top of the page or highlight your code and use the </> button in the post toolbar.

Given the little you’ve said about how to interact with this switch, I would think the RESTful Switch is probably not the right component for you to use. E.g., this component seems to only use GET to check the state of the switch, and PUT or POST to change the state of the switch. But it would seem your switch needs to be changed via GET requests. (This probably explains why the switch keeps going back on. I.e., whenever HA periodically tries to update the state of the corresponding HA entity, it’s sending a GET request using the URL you provided, which doesn’t get the state of the switch, but turns it on.)

You may be better off trying to use the Command Line Switch (e.g., using curl commands.)

Thanks for the response,
I was able to get the results I want using command line and it is working well,
Would be great if the Fibaro controller could be added like a Vera one