I type this url in my browser to turn on my lamp:
http://192.168.1.58:9192/b4:43:0d:39:1b:f8/run/id/1/
and this one to extinguish it:
http://192.168.1.58:9192/b4:43:0d:39:1b:f8/run/id/3/
I wanted to use HTTP binding but it is not in the Add-ons!
So, I created an item (lamp) then 2 rules in PaperUI to activate it:
if an item (LampSalon) receives a command (ON)
execute a given script
sendHttpGetRequest ( “http://192.168.1.58:9192/b4:43:0d:39:1b:f8/run/id/1/”)
if an item (LampSalon) receives a command (OFF)
execute a given script
sendHttpGetRequest ( “http://192.168.1.58:9192/b4:43:0d:39:1b:f8/run/id/3/”)
When I test the rule, I get this error:
[ome.event.ItemCommandEvent] - Item ‘LampeSalon’ received command ON
[.event.RuleStatusInfoEvent] - dc814b5c-c4ec-41a7-93fc-439760d050f2 updated: RUNNING
[wind.ItemStateChangedEvent] - LampeSalon changed from OFF to ON
[ERROR] [internal.handler.ScriptActionHandler] - Script execution failed: ReferenceError: “sendHttpGetRequest” is not defined in at line number 1
How can we just send an http command in openhab2?
- Platform information: openHAB 2.2.0-1 (Release Build)
- Hardware:
Release = Raspbian GNU/Linux 9 (stretch)
Kernel = Linux 4.9.59-v7+
Platform = Raspberry Pi 3 Model B Rev 1.2
- Hardware: