123
Senior Member
After spending a great deal of time with scripting, I thought I'd never need to stoop to using Macros or Logic Diagrams. I'd become a "scripting hammer" where every problem must be solved through coding. If you can write code, you've mastered the Premise universe, right? Wrong, silly rabbit! After spending a little time with Logic Diagrams, I realized that they can solve some problems with less effort than scripting.
Light and Auto-On/Off Fan
Here's an example straight out of the manual:
Variable-Brightness Light and Auto-On/Off Fan
Think we're limited to Boolean logic? Not at all. Here's an example, a slight variation of the one in the manual, that uses a Multiplexer block:
Auto-On/Off Variable-Brightness Light and Auto-On/Off Fan
Rather than turn the light on manually, we can trigger it by sensing motion or pressure:
If you have a RadioTuner in the bathroom, well, drag that into the diagram as well and activate it along with the light!
Without writing a single line of script, we've programmed the light and fan (and radio). As an added bonus, this logic diagram remains valid even if you change the Vanity light from Insteon to UPB and the Fan from X10 to a hard-wired relay. All logic resides on a "separate layer" from device drivers so it remains effective regardless of the device's technology.
You can also create custom Logic Blocks but that requires scripting. There are several examples in the manual including how to create an Emailer block.
Light and Auto-On/Off Fan
Here's an example straight out of the manual:
- Turn on a bathroom light.
- Two minutes later the ventilation fan turns on.
- Turn off the bathroom light and ten minutes later the fan turns off.
Variable-Brightness Light and Auto-On/Off Fan
Think we're limited to Boolean logic? Not at all. Here's an example, a slight variation of the one in the manual, that uses a Multiplexer block:
- Light's default brightness is 75% during the Day.
- Light's default brightness is 100% during the Evening.
- Light's default brightness is 50% during the Night
Auto-On/Off Variable-Brightness Light and Auto-On/Off Fan
Rather than turn the light on manually, we can trigger it by sensing motion or pressure:
- Turn the light on if there's Motion
- Turn the light on if there's weight on a pressure-sensitive mat.
- Turn the light off after 1 minute of inactivity.
If you have a RadioTuner in the bathroom, well, drag that into the diagram as well and activate it along with the light!
Without writing a single line of script, we've programmed the light and fan (and radio). As an added bonus, this logic diagram remains valid even if you change the Vanity light from Insteon to UPB and the Fan from X10 to a hard-wired relay. All logic resides on a "separate layer" from device drivers so it remains effective regardless of the device's technology.
You can also create custom Logic Blocks but that requires scripting. There are several examples in the manual including how to create an Emailer block.