IFTTT to turn On/Off PC

Hi,

Can someone help me understand what info I input into IFTTT to trigger a switch that I’ve successfully setup to turn my PC On/Off

I can’t make sense of the HomeAssistant URL /api/services/TURN_OFF? method and what I need to change it to as well as what I should be entering into the body section of the IFTTT web request setup page.

The working code that I have setup in configuration.yaml

switch:

  • platform: command_line
    switches:
    gaming_pc:
    command_on: “wakeonlan AC:22:0B:CA:96:35”
    command_off: “net rpc shutdown -I 192.168.0.10 -U 1234322%1234322”

Thanks in advance for your help :grin:

Hi assuming you have HA set up for remote access via DNS etc you need to add the ffg under URL on the maker channel http://yourdnsaddress:8123/api/services/switch/turn_on?api_password=yourpassword

do turn_off for switching off

then select post under method. application/json under content type.

Under body you will input the entity ID e.g. {“entity_id”:“switch.gaming_pc”] your ID may vary check HA states to confirm.

Good Luck

If you would like a full IFTTT tutorial check out Ben’s Channel here https://www.youtube.com/watch?v=-Tkb04xRs-o

Perfect thankyou.

It didn’t work at first but then I noticed the below was wrong, now works a treat thankyou and I now understand how it works :slight_smile:

Should be

Sorry about that mistype. Glad you got it working!