Borgen
August 15, 2023, 8:22am
1
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.
Borgen
August 15, 2023, 8:32am
3
@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.
Borgen
August 15, 2023, 9:04am
5
@robertklep Yes should be Body and Header…
Will try it out later this evening
Borgen
August 15, 2023, 1:58pm
6
@robertklep It worked just fine! Thanks for the tip!