Page 1 of 1

Insteaon: Setting DIm level with button control

Posted: Sun Sep 16, 2007 10:18 pm
by Steve Horn
Ok, so now I'm sold on Insteon. But I need help - I have added two button controls to control the dim level of an Insteon lamp dimmer. One button for brighten; one for dim. (There is a separate multistate button to turn the device on and off.) Each button ideally increases or decreases the value of the dim level property by some fixed amount. Example: One click of the brighten button adds 10 to the current dim level of the device. The dim button decreases the value of the dim level by 10. Except it doesnt work. My brighten and dim tasks (triggered by the bright and dim buttons) each have one statement that reads something like:
Change 'Theater->Lighting\Theater wall washers.Dim Level' to '%%Theater wall washers.Dim Level%% + 10'
(Thats for the brighten task. The dim task decrements by 10.)
What happens is the Dim task dims the light to the preset dim value, set up at the switch. Changing the value (-10) does not affect the resulting dim level. The brighten task more often than not crashes the HB server.
Sorry to be so wordy, but I'm obviously overlooking something either Insteon or HB related. Anyone have a similar setup?

Posted: Mon Sep 17, 2007 9:53 pm
by ScottBot
Steve,

That looks like a HouseBot issue, not related to Insteon. The problem is that using the value of the target property as the substitution string to set the target property throws HB into a loop.

Posted: Mon Sep 17, 2007 10:24 pm
by Steve Horn
Ok, thanks. I tried to come up with another way to do this but have nothing so far. I suppose I could use a slider to adjust the dim level, but I've found sliders to be cumbersome using a touch screen display.

Posted: Tue Sep 18, 2007 1:53 pm
by ScottBot
You could also do the same thing with a simple script (without using PV substitution). Or maybe even create a duplicate property that mirrors the value of the one you are updating to be used in the Task (I haven't tested that, but it's just a theory/suggestion).

Posted: Fri Sep 21, 2007 12:17 am
by Steve Horn
Ok, I created a VB script that brightens the light by 10 percent (sort of.. increases the Dim Level property by 10). That was interesting, as my VB Script knowledge is very limited. Anyway... several questions arise. 1) How can one pass parm values to the script from the task that calls it? (Why should I have to create a bunch of virtually identical scripts when only a few variables (i.e. Insteon device, dim increment, dim direction (+/-) change?)
2) Why is the resulting device Dim Level Value off by one from what I set it to? (no big deal, curiosity question.)

Posted: Fri Sep 21, 2007 8:28 pm
by jkish
You can create a script device that has properties that you set for the variables you would have passed to the script. The device script is always running and picks up work to do (dim a light, etc) from a device property and then looks at other device properties for other settings (which light, how much to dim, etc)