Help with rest/command line switch


I have this great IR controller,

i want to integrate the buttons from the device to HA using

This is example of the Push URL:

what will be the best way + example to use?

you can use either function. You’ve posted links to the docs, so you managed to find them. If you scroll down you’ll see examples for you to copy and adapt to your needs

i didnt understand this one:

can you write me sample for 1 button with any method ? i will try…

Not sure what command this does (on or off) http://192.168.x.x/integration/push?code=34234234324
but assuming it’s the on command, you would define like this:

  platform: command_line
      command_on: "/usr/bin/curl -X GET http://192.168.x.x/integration/push?code=34234234324"
      command_off: "/usr/bin/curl -X GET"
      command_state: "/usr/bin/curl -X GET"
      value_template: '{{ value == "1" }}'
      friendly_name: Kitchen Lightswitch

You need to update the above command URLs for the On, Off commands, and the State one.
The value template is a formula that tells HA what value means on. In above example, the command_state URL would return only 1 character: “1”. The Value template tells HA that 1 means on