0
Answered

http level button

Alexandre Jacob - Home heaven 9 years ago in iRidium Script / AV and Driver scripts updated by Oksana (expert) 9 years ago 2

Hi,

I want to create a new driver for a zwave box called jeedom.

The driver is http type and the commands are like :


http://172.27.175.53/core/api/jeeApi.php?apikey=

rHCc73U&type=cmd&id=88&slider=4


When creating a new script, I can connect to http device and send the url wich send the value 4 in to equipment.

Unfortunately, this value is a level (4 to 28)

So I want to create a level button to increase or decrease the value. But I can't send a different value automatically from the script.

Do you have any idea?


The feedback is like that :


http://172.27.175.53/core/api/jeeApi.php?apikey=rHCc73U&type=cmd&id=89

and send me the actual value on a web page but I can't reeive data in Iridium :-(


Thanks in advance for your precious help

Best regards



+1

You need to get value from Level element and use it in script. Like this:

IR.AddListener(IR.EVENT_ITEM_RELEASE, IR.GetItem(Page).GetItem(Level), function()

{
DEVICE.Send(['POST,/cgi-bin/audio/request.cgi,request=cmd&cmd=set_vol¶m=',IR.GetItem(Page).GetItem(Level).Value]);
}

In this code ",/cgi-bin/..." it is some of mine links