Switching on a WiFi enabled relay

Hello,

I’m trying to work out how to switch on a Wi-Fi enabled relay, in particular the Blebox.eu switchbox v2.
The company said that I need to issue this command to it :-

IF object.detected THEN send(http://blebox-IP-address-goes-here/api/1/1)

Where the first one is the relay number, mine will always be 1 as it isn’t the version with two relays, and the second 1 refers to the ON state, 0 being the off state.

Where does this information go in the Vera interface? I’m fine where it simply involves switching on/off z wave devices but not IP devices.

Any advice would be appreciated.

Regards

Gavin

[quote=“Gavo, post:1, topic:200612”]Hello,

I’m trying to work out how to switch on a Wi-Fi enabled relay, in particular the Blebox.eu switchbox v2.
The company said that I need to issue this command to it :-

IF object.detected THEN send(http://blebox-IP-address-goes-here/api/1/1)

Where the first one is the relay number, mine will always be 1 as it isn’t the version with two relays, and the second 1 refers to the ON state, 0 being the off state.

Where does this information go in the Vera interface? I’m fine where it simply involves switching on/off z wave devices but not IP devices.

Any advice would be appreciated.

Regards

Gavin[/quote]

At a guess using

os.execute (curl http://blebox-IP-address-goes-here/api/1/1)

in your action would be a good place to start.

C

Thankyou, a lot further on now.

I was reading the documentation from the manufacturer a bit too literally, the “api” was meant to be substituted by an “S” representing a change of state.

Through a bit of experimentation I can now switch the relay on and off from the command line of my windows laptop by issuing these commands :-

curl http://192.168.9.26/s/1 where the relay has an ip address of 192.168.9.26 , S meaning a state change and 1 meaning ON

and

curl http://192.168.9.26/s/0 to turn off

However I haven’t got to the stage where my Vera Plus device can do this. Where exactly do I enter the command of :-

os.execute (curl http://192.168.9.26/s/1) ?

I’m guessing the completely wrong place - I’ve put it in the “Finish the scene, Also, execute the following Luup code:” section

The device actions section points me to Z wave devices on my Vera system - can I create some virtual device that by switching on it issues the

os.execute (curl http://192.168.9.26/s/1) command ?

Thank you for your time, most appreciated.

Gavin

That’s exactly where I’d have suggested.

First off. Are you comfortable using ssh to get a command interface on your vera? If so:
curl ‘http://192.168.9.26/s/1

from the vera should also work. If not let me know.

But I suspect if you alter your current luup code to

os.execute (‘curl http://192.168.9.26/s/1’)

with the quotes, you might have it working

C

You’re a genius !

That’s sorted.

Many Thanks

Gavin

[quote=“Gavo, post:5, topic:200612”]You’re a genius !

That’s sorted.

Many Thanks

Gavin[/quote]

I wish I was! Just old and experienced in the oddities of OS command syntax. :wink:

Glad it worked (or at least I assume it did!) :smiley:

C