use percentage blinds as trigger signal Topic is solved

Moderator: leecollings

Post Reply
sailmich
Posts: 245
Joined: Wednesday 17 February 2016 22:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany
Contact:

use percentage blinds as trigger signal

Post 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.
User avatar
jvdz
Posts: 2335
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: use percentage blinds as trigger signal

Post by jvdz »

What about:

Code: Select all

elseif (tonumber(otherdevices_svalues['kitchen left']) >= 64 and sUV >2)
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
sailmich
Posts: 245
Joined: Wednesday 17 February 2016 22:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany
Contact:

Re: use percentage blinds as trigger signal

Post 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.
User avatar
bewo
Posts: 74
Joined: Monday 13 July 2015 12:27
Target OS: Linux
Domoticz version: 2021.1
Location: Bavaria - Germany
Contact:

Re: use percentage blinds as trigger signal

Post 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
Individual projects:
Domoticz on a Intel Xeon Server | AeonLabs Z-Wave Gen.5 | RFXCOM RFXtrx433E USB | ESP-Wifi-Modules | Shellys
Wall-mounted 22" Touch Control Display (self construct) | LUA wind monitor| LUA heating control | and many many more :)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest