From: Bruce W. <br...@mi...> - 2002-09-30 12:59:58
|
> Ok, this is what I what to do, when a motion sensor triggers a light that > has been dimmed to 0% dims up to 50%. When the motion sensor send its off > command the lamp should dim back down to 0%. > > Below is the code that I thought should do it but something's wrong. > > > In the initial script/not in the loop: > Set $lamp 'on'; > Set $lamp '0'; > > > In the loop: > Set $lamp '50' if ((state_changed $Motion) eq 'on'); > Set $lamp '0' if ((state_changed $Motion) eq 'off'); > > What am I doing wrong? You need to include %. Without it, it is interpreted as relative +- increases, rather absolute levels. So 50 is like +50 and 0 is like +0. Bruce |