Page 1 of 1

Script error blocky, compare number with string

Posted: Sunday 08 November 2015 14:12
by koenjer
Hi There,

I´m trying to use the second switch input on a Qubino dimmer to work as a secundary switch for my kitchen lights.
In dutch called a `wissel schakeling`.

The problem is that the kitchen light is always dimmed to +/- 50% when on. So the state in Domoticz is not Always "ON" but sometimes
showed as 50%.

When i'm trying this blocky script I get a error.

Error:
Name: Wisselkeuken => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare string with number

Re: Script error blocky, compare number with string

Posted: Monday 09 November 2015 10:48
by mrf68
Hi koenjer,

try this:
20151109 forum.jpg
20151109 forum.jpg (18.04 KiB) Viewed 1010 times
EDIT: but I think it won't work as expected. Because when the Wisselschakelaar Keuken is On and you activate the dimmer, the script will turn the light of again. You can probably fix that by setting the Off Delay to let's say 5 seconds, so it will turn off automaticaly. Then you will be able to use the other switch to turn the lights on again.