Blinds percentage value Update

Post Reply
mehdiakrim
Posts: 1
Joined: Thursday 07 September 2017 16:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Blinds percentage value Update

Post by mehdiakrim » Thursday 07 September 2017 16:39

Hello

I use this lua Script to controle blinds, I take the blinds bercentage value from dashboard and send it to my IPX800 via API.

Code: Select all

commandArray = {}
val=  tonumber((otherdevices_svalues['Volet Salon TV']));
val1=101-val
if (devicechanged['Volet Salon TV'])  
 then 
--then val=  tonumber((otherdevices_svalues['VR']));
str= "http://192.168.1.152/api/xdevices.json?SetVR03="..val1
 commandArray['OpenURL']= str
end
if devicechanged['Volet Salon TV'] == 'On' then 
     str1= "http://192.168.1.152/api/xdevices.json?SetVR03=0"
     commandArray['OpenURL']= str1
end
if devicechanged['Volet Salon TV'] == 'Off' then 
     str1= "http://192.168.1.152/api/xdevices.json?SetVR03=100"
     commandArray['OpenURL']= str1
end
return commandArray
The probleme is when i get Pushes from my automate (ipx800) indication the current state of my blinds like this one for example :
http://ip:8080/json.htm?type=command&pa ... svalue=Off

it triggers the script and the blinds start moving again . its like a loop
So my question is : is there a way to change the cursor or (on/off) on my blinds icon without triggering the lua script related to it

Thank you

morilm
Posts: 27
Joined: Friday 27 January 2017 13:57
Target OS: OS X
Domoticz version:
Contact:

Re: Blinds percentage value Update

Post by morilm » Thursday 07 September 2017 17:01

You should try the "update device":


commandArray = {['UpdateDevice'] = otherdevices_idx[device_name]..'|0|0'}


first 0 is the nvalue, 0 = off, 1 = on

Second 0 is the svalue. Some switches use it for different values, like blind %

This way the corresponding event of the device will not be triggered

Hope it helps
Miguel

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests