Creating a webhook

I just want to create a very simple webhook with a flic button click, how comes is so difficult to make it work :frowning:
here is my configuration file:

binary_sensor:
  platform: flic
  
automation:
  - alias: flic toggle
    trigger:
      platform: event
      event_type: flic_click
      event_data:
        button_name: flic_12345678
        click_type: single
    action:
      service: flic.toggle
      entity_id: flic.hotwater
      

  - platform: command_line
      hotwater:
      toggle: "curl http://192.168.1.4/hotwateron.php"

Could anyone please help?

The above doesn’t mean anything to HA, you need something like…

    service: homeassistant.turn_on <--------------you may be able to use .toggle here instead of .turn_on
    entity_id: switch.hotwater

and for the command_line…

  - platform: command_line
      hotwater:
      command_on: "curl http://192.168.1.4/hotwateron.php"
      command_off: "curl http://192.168.1.4/hotwateron.php"

Hopefully that will help out, however you could also read the command line component docs.

Not working whatsoever. Is this a sorcery? I do not know it will be such difficult.
Home Assistant = Wizard Assistant :joy:

OK, does it work from the ssh command line terminal? So if you type in curl http://192.168.1.4/hotwateron.php does it work, HA will need the full path to curl probably /usr/bin/curl and you will probably need to setup the permissions for homeassistant to use it.

Can you trigger it from the frontend in HA via the automation, find it in the frontend and click on it’s name, then in the card that pops up click trigger, does that work?

It is a bit of a steep learning curve :stuck_out_tongue:

I can successfully execute /usr/bin/curl http://192.168.1.4/hotwateron.php in ssh command line terminal.
In the frontend, I TRIGGER, it says “service/automation called.”

Now probably the trouble is the permission for HA to use curl. I’m still looking for the way to grant the permission :sweat_smile:
However, I really thank you for your patience :joy: