lux level checking

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

lux level checking

Post by markjgabb »

hey guys

this may be answered elsewhere but searching based on lux is hard when built in search ignores it

i have a lux sensor in my house that i want to evaluate as part of a someone is home script

im trying to use it in a if statement but it fails each time

if domoticz.devices('Lounge Light Level').lux() > 50 then

it fails the lookup with the following error

2017-08-23 17:44:58.276 Error: dzVents: Error: ...icz/scripts/dzVents/generated_scripts/no one is home.lua:41: attempt to call field 'lux' (a number value)

im guessing ive written the statement wrong?
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
elmortero
Posts: 248
Joined: Sunday 29 November 2015 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Spain
Contact:

Re: lux level checking

Post by elmortero »

try: if domoticz.devices('Lounge Light Level').lux > 50 then, without the ()
it should work then. See post DzVents: next generation
Post Reply

Who is online

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