Script error blocky, compare number with string

Moderator: leecollings

Post Reply
koenjer
Posts: 4
Joined: Wednesday 29 July 2015 14:29
Target OS: Windows
Domoticz version: 3.8153
Location: Netherlands
Contact:

Script error blocky, compare number with string

Post 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
Attachments
blocky.jpg
blocky.jpg (24.46 KiB) Viewed 1028 times
mrf68

Re: Script error blocky, compare number with string

Post by mrf68 »

Hi koenjer,

try this:
20151109 forum.jpg
20151109 forum.jpg (18.04 KiB) Viewed 1009 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests