How do I do a Homey Script for this?

Trying to “control” another device by executing an http request to the device, it works if I in a browser put in the following line (obviously with other correct username & password):

http://username:password@192.168.1.1/api/plugins/callUIEvent?deviceID=1628&elementName=lbl_ChargerOn&eventType=onReleased

But how do I create a script in Homey Script that then can be called in a Flow?

Why not use a Logic card, if you just have to make an HTTP request you don’t need HomeyScript.

@robertklep Hmmm so you mean use the Logic card:
Do a HTTP ‘method’ request to ‘url’ with subject ‘subject’ and context ‘context’

But what Method should be used and how do I divide the line into Url, subject and context?

I hope that “Subject” and “Context” are translations for “Body” and “Headers”.

The method to use is GET, body and headers can be left empty, the URL is the URL that you posted.

@robertklep :slight_smile: Yes should be Body and Header…

Will try it out later this evening

@robertklep It worked just fine! Thanks for the tip!