There are 2 scripts that might do what you need already. There is a level memory program that will remember and set the dim level of a light every time it's turned on. There is also a program that turns the light on to 100% when it is turned on. I think the second is what you are looking for.
Thanks! There doesn't seem to be one that does exactly what I described, but I'm using the source from the two you mention to cobble together a "Connected Switches" program. However, I'm having a problem grabbing the "name" of the connected switch.
Specifically, I do this for the parameter in the trigger section:
Program.AddFeature("HomeAutomation.ZWave", "Light,Dimmer,Switch", "HomeGenie.ConnectedSwitches.ConnectedModule", "Name of the module to connect to", "module.text:any:light,dimmer,switch:module.name");
Which works. I can choose "Living room lamp" for that field. And then I attempt to do this in the program section (partial code):
var connectedModuleName = module.Parameter("HomeGenie.ConnectedSwitches.ConnectedModule").Value;
Program.Notify("Connected Switches", connectedModuleName);
Modules.WithName(connectedModuleName).On();
However, "connectedModuleName" is equal to "HomeAutomation.ZWave:14" instead of "Living room lamp", and there doesn't appear to be a way (that I can figure out) to convert it to the real name to use with "WithName"
Any ideas?
Another note, and I don't know if this is just the UI, but the Notify doesn't occur when I press the switch, only when I turn on the lights via the web interface. This uses the same basic code structure as the Energy Management plugin to limit brightness.
*Edit* Even hardcoding the name doesn't work. As before, it only works if I use the web interface to turn on the switch, not if I hit the switch manually. Is there a way to make wall switches "broadcast" the on/off event?
*Edit 2* Using level polling in combination works when the switch is used, but this creates a ton of notifications on the web dashboard every 5 seconds. Still looking for a "broadcast" function if possible.
*Edit 3* And I am seeing this in the log when turning the switch on/off:
./homegenie.log:2015-08-06T17:27:41.1493370-04:00 HomeAutomation.ZWave 12 ZWave Node ZWaveNode.WakeUpNotify 1
./homegenie.log:2015-08-06T17:27:53.6346300-04:00 HomeAutomation.ZWave 12 ZWave Node ZWaveNode.WakeUpNotify 1
Thanks again!