Page 1 of 1

Comparing a Shutter value

Posted: Tuesday 16 May 2017 16:21
by DutchHans
Good afternoon everyone...

I want to check if a shutter is open; if not; then open it.. the only thing that happens is that every minute the shutter gets a signal to go to 100 (open), even if it is 100 (open)

I have tried to compare svalues and current state but it doesnt like it:

Code: Select all

if otherdevices_svalues['Blinds Office']~= 100 then... 
if otherdevices['Blinds Office']~= 'Open' then... 
both don't work..

What is the correct syntax, I can't find it on the forum nor in the wiki?
Regards, Hans

Re: Comparing a Shutter value

Posted: Tuesday 16 May 2017 16:25
by emme
sValue should be a String value
try with
otherdevices_svalues['Blinds Office']~= '100'

or
blindLevel = tonumber(otherdevices_svalues['Blinds Office'])
if blindLevel ~= 100 then

be aware that in my case "Open" state means sValue 0, any other value means "Closed"