Page 1 of 1

use percentage blinds as trigger signal

Posted: Saturday 29 September 2018 11:51
by sailmich
Newest Beta
Raspberry Pi2
ZStick

How can I use the percentage of my blinds as a trigger signal for Lua? elseif (otherdevices_svalues['kitchen left'] >= 'Set Level: 64 %' and sUV > 2) don't work. Tried with elseif (otherdevice_svalues['kitchen left'] >= 64 and sUV >2) without succeed.
With /json.htm?type=command&param=switchlight&idx=99&switchcmd=Set%20Level&level=6
I can set the blind to differnt level. I assume I have to use something with level inside the script but I can't find the right code.

elseif (otherdevices['kitchen left'] == 'Closed' and sUV > 2) works.
Please can someone point me in the right direction.

Re: use percentage blinds as trigger signal

Posted: Saturday 29 September 2018 12:11
by jvdz
What about:

Code: Select all

elseif (tonumber(otherdevices_svalues['kitchen left']) >= 64 and sUV >2)
Jos

Re: use percentage blinds as trigger signal

Posted: Sunday 30 September 2018 8:00
by sailmich
Jos, thank you very much, that did the trick with trigger
But now I have problem to set the blind to a specific value. Can't find a commandArray in Domoticz documentation. SetSetPoint doesn't work. Any idea?
I would like to set my blinds in my kitchen to 60% when the sun radiation is higher than 500 that protect against head up my kitchen but it is still bright enough.

Re: use percentage blinds as trigger signal

Posted: Tuesday 30 October 2018 16:07
by bewo
When 'kitchen left' is your blind and sUV is your sun radiation, i think it should be

Code: Select all

commandArray = {}

        if (tonumber(otherdevices_svalues['kitchen left']) >= 61 and sUV >500)

        then

        commandArray ['kitchen left'] = 'Set Level 60'

        end

return commandArray