InsteonPLM binding support for FAST ON and FAST OFF

I added a message-handler in my custom device features to map Fast On (0x12) and Fast Off (0x14) to LightOnSwitchHandler and LightOffSwitchHandler respectively, so the binding will properly track if I double press the light switch to trigger a Fast On or Fast Off, but was wondering if there’s a way in my rules to detect a double press and perform a custom action. What I’m going for is triggering all lights off when I double press the off button on my bedroom light switch.

I added support for that:

Referenced here:
https://groups.google.com/forum/#!msg/openhab/8C_xjQ9Va_Q/_CmMPKLCFQAJ

But nobody bothered to test and give me feedback.

Bernd

Just so I’m clear, this is not implemented in the version of the addons package that comes with 1.7, correct? If so, guess I’m learning how to build an addon from source!

Thanks,
Matt

A more painless way to get the latest build would be to use the openhab’s automated build server. You can download the latest build here:

https://openhab.ci.cloudbees.com/job/openHAB/org.openhab.binding$org.openhab.binding.insteonplm/

You’ll want the .jar

Daniel

That one does not have my insteonplm branch. Is there a way to get the automated build server to build my private repository (or branches thereof). I know that submitting a pull request builds it, but I don’t want to submit a PR just to get it built.

My bad, I didn’t realize that the changes were not yet pulled into the main tree. I guess you’ll have to build from source then.

Daniel

I built the updated insteonplm addon from your repo. Am I going to have any issues dropping this into the 1.7 release I have running at home, or am I going to need to upgrade to the 1.8 snapshot from the repo?

Not sure, you can try, good chance it’ll work. If it doesn’t work, try to replace all of it. Your config files can stay the same.

I usually build from the very top of the tree (mvn clean install), and I have cobbled together a script that runs and copies all the bindings I use (and the core system) into the runtime directory.

I’ll give it a shot when I get home and report back with how things work out.

Sorry I am a bit clueless here, what do people use fast on / fast off for? Just another command that openhab can act on vs just on / off?

Exactly. So if you double tap your dimmers and switches they send out a broadcast on a different group than if you just toggle them. So you could e.g. double tap one dimmer and trigger openHab to switch off all lights in the house. If that’s what you want to do…

Off-topic: I just managed to set the time for my insteon thermostat via a python command line tool.

Very nice! I ended up ditching (anyone need a bunch of stats?) Insteon stats and went with Z-Wave CT100s. The clock thing was on the list, but also had issues with Off state, temp / humidity accuracy, and bad data.

Double tap the switch in my bedroom to trigger all lights off for my apartment. Also, if you create a scene where the responder is OFF, when you single tap on, only the controller will turn on. Double tap on and both the controller and responder will turn on, as the stored level is ignored for fast on. It’s an easy way to get two different light scenes from a standard switch.

Good news everybody! The 1.8.0-SNAPSHOT jar worked perfectly in my 1.7.1 environment (once I switched the build tree over to insteonplm from master). Fast on and off behaved exactly as expected. There was a few second delay between the button press and the action, but I think this is unavoidable given the way Insteon works. I didn’t have a change to try out the manual dim feature though. Hopefully tonight.

@Bernd_Pfrommer rocks!!!

I tested out the new changes to the binding. I’m seeing some unexpected behavior. Maybe bugs?

21741 2015-09-16 12:52:07 - masterBedLights state updated to ON
21742 2015-09-16 12:52:08 - masterBedLights state updated to 58
21743 2015-09-16 12:52:13 - masterBedLights state updated to OFF
21744 2015-09-16 12:52:18 - masterBedLightsFastOnOff state updated to ON
21745 2015-09-16 12:52:22 - masterBedLightsFastOnOff state updated to OFF
21746 2015-09-16 12:52:26 - masterBedLightsFastOnOff state updated to ON
21747 2015-09-16 12:52:33 - masterBedLights state updated to OFF
21765 2015-09-16 12:54:14 - masterBedLightsFastOnOff state updated to ON
21766 2015-09-16 12:54:24 - masterBedLights received command 42
21767 2015-09-16 12:54:25 - masterBedLights state updated to 42
21768 2015-09-16 12:54:28 - masterBedLights state updated to OFF
21769 2015-09-16 12:54:34 - masterBedLightsFastOnOff state updated to ON
21770 2015-09-16 12:54:36 - masterBedLights state updated to ON

I added the masterBedLightsFastOnOff item as a Switch with #fastonoff. masterBedLights was already a Dimmer item with #dimmer. I tried setting masterBedLightsFastOnOff as Dimmer item and the behavior seems to be the same.

When I double tap the switch, you can see in the log lines that the FastOnOff state is updated to ON or OFF. The physical light goes on or off immediately when I do that. However, the state of the masterBedLights item does not receive an update.

I’m wondering if this should be implemented in a different way. Would it make more sense not to have an additional Item in the insteon.items file, but instead reuse the existing one with feature #dimmer,fastonoff? That way, a rule file could do something like this:

Rule “Rule Name”
when
Item masterBedLights received command FAST_ON
then

Any thoughts?

Oh, and I had to add FastOnOff to F00.00.01 to make it work. Would you mind adding that in the device_types.xml?

 <device productKey="F00.00.01">
     <model>2477D</model>
     <description>SwitchLinc Dimmer</description>
     <feature name="dimmer">GenericDimmer</feature>
     <feature name="manualchange">ManualChange</feature>
     <feature name="fastonoff">FastOnOff</feature>
     <feature name="lastheardfrom">GenericLastTime</feature>
 </device>

However, the state of the masterBedLights item does not receive an update.

I checked last night on my F00.00.02, and my behavior was as expected, openHAB was properly tracking the light switch itself with no delay.

That’s interesting. So there may be something wrong in my configuration. Here are my items. Would you mind posting yours?

Dimmer masterBedLights                   "Master Bedroom Lights"  <bedroom>   (gMaster_Bedroom) {insteonplm="xx.xx.xx:F00.00.01#dimmer"}
Switch masterBedLightsFastOnOff          "Master Bedroom Lights FastOnOff" <bedroom>(gMaster_Bedroom) {insteonplm="xx.xx.xx:F00.00.01#fastonoff"}

What version of openHAB runtime are you using? I’m using 1.7.1 and I dropped the 1.8.0 snapshot of insteonplm into that deployment. Maybe I’ll need to try updating the whole thing…