Comparing a Shutter value

Moderator: leecollings

Post Reply
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Comparing a Shutter value

Post 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
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Comparing a Shutter value

Post 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"
The most dangerous phrase in any language is:
"We always done this way"
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest