Stateless switch using REST Switch

Hello,
I am trying to migrate all of my devices from Homebridge to Homeassistant. Everything is seemless but I struggle with one set of devices.
I have a few switches which are controlled using esp8266 and triggered by url.
These switches are stateless however I do not know their current state and I do not need to know it. The same url turns the device on and then off.

Here is the configuration I had in homebridge:
“accessory”: “HTTP-SWITCH”,
“name”: “Lights”,
“switchType”: “stateless”,
“onUrl”: “http://x.x.x.x/setButton?button=13

I tried using REST Switch with the following configuration:
switch:

I was able to control the lights but they were being turned on and off periodically. (I am guessing when it was trying to get the state?)

How would I go around making stateless switch using rest?

There is no such thing as a stateless switch, but you can use a button.

  1. REST command: RESTful Command - Home Assistant
  2. Input Button: Input Button - Home Assistant
  3. Automation to link them together (as in the example in the button docs)

You could also just make the command and always call the service if you want to toggle your switch.

Hi. How can I do that?

input_button:
  ring_bell:
    rest_command:
        name: Ring bell
        icon: mdi:bellrest_command:
        url: http://192.168.2.XX:11080/endpoint/48/public/

I tried to use it on configuration.ymal, but I got an error message.

Do you know what’s happening?