Hi All,
I am using two teckin sp22 Powerplug with homeassistant and esphome to control them.
Now these two devices have one button included. i want to use the button to turn the other plug on or off.
As i got told the only way to switch a plug from another plug is over MQTT or RestFULL API.
Here is how i imagine to switch the device via HTTP API command
In the plug1.yaml i include the following sensor:
binary_sensor:
- platform: gpio
pin:
number: GPIO1
inverted: True
name: "${plug_name}_button"
on_press:
then:
- url: "https://homeassitant/api/services/homeassistant/toggle/{“entity_id”:“switch.p1_relay”}?api_password=myapipass"
but that url doesent work. if i try it in the browser i get the message: 405: Method Not Allowed
If i do a test with the homeassistant dev tools the switch toggles.
has anyone an idea how the url should look like ?