InsteonPLM binding support for FAST ON and FAST OFF

1.7.1 with the 1.8.0-SNAPSHOT insteonplm binding. Here is the configuration I’m using:

Switch Light_Bedroom_Nightstand                 "Night Stand"   (Bedroom, Lights) {insteonplm="AA.BB.CC:F00.00.02#switch,related=DD.EE.FF"}
Switch Light_Bedroom_Nightstand_DoubleClick     "Night Stand (Double Click)"    {insteonplm="AA.BB.CC:F00.00.02#fastonoff"}

Here is the events.log from last night when I turned everything off:

2015-09-16 21:51:25 - Light_Bedroom_Nightstand_DoubleClick state updated to OFF
2015-09-16 21:51:25 - Light_Bedroom_Nightstand state updated to OFF
2015-09-16 21:51:25 - Lights received command OFF
2015-09-16 21:51:25 - Light_Living_Shelf received command OFF
2015-09-16 21:51:25 - Light_Bedroom_Dresser received command OFF
2015-09-16 21:51:25 - Light_Bedroom_Nightstand received command OFF
2015-09-16 21:51:26 - Light_Living_Shelf_Level state updated to OFF
2015-09-16 21:51:26 - Light_Living_Shelf state updated to OFF

Now that I think about it though, I’m also explicitly setting everything off in my rules. If I have time tonight, I’ll disable the rule and test again.

Added fastonoff feature now for all devices where it makes sense (lights, dimmers).

Only the switches will update their state properly when faston and fastoff are clicked.
The dimmers do not handle it correctly (they don’t have a handler installed). Bug.
Fixing it.

Fixed with PR 3205:

The pull request has a link to a pre-compiled jar file.

Ok, this is working better for me. With these bindings:

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

I now get the following in the events log, which is just as I would expect:

6335 2015-10-02 12:11:28 - masterBedLightsFastOnOff state updated to ON
6336 2015-10-02 12:11:28 - masterBedLights state updated to ON
6337 2015-10-02 12:11:34 - masterBedLightsFastOnOff state updated to OFF
6338 2015-10-02 12:11:34 - masterBedLights state updated to OFF

My problem now is that I can’t seem to get the fastonoff feature to trigger any rules. I have the following rules for the above items. When I trigger the fast on or fast off, I never see any of the log statements in the rules and the loft light doesn’t change. Am I doing something wrong in these rules?

rule "Turn off loft light when master bedroom light double tapped"
	when Item masterBedLightsFastOnOff received update OFF
	logInfo("masterBedLights FastOnOff", "received update OFF")
	sendCommand(loftLight, OFF)

rule "Turn off loft light when master bedroom light double tapped 2"
	when Item masterBedLightsFastOnOff received update ON
	logInfo("masterBedLights FastOnOff", "received update ON")
	sendCommand(loftLight, ON)

rule "Turn off loft light when master bedroom light double tapped 3" 
	when Item masterBedLightsFastOnOff received command
	logInfo("masterBedLights FastOnOff", "masterBedLightsFastOnOff Received command [{}], state=[{}]", receivedCommand.toString(), masterBedLightsFastOnOff.state.toString())

Xtend scripting sucks big time, every which way. What do you expect, error messages? That’s for whimps!!!
Real men debug by trial and error!

Here’s my advice:

  1. Switch to python scripting. I just wasted a full day or more to debug some problems with that, fun, fun. But it’s worth it. You get error messages and a well documented language without some screwy syntax like “Item changed” etc. Look for “jsr223” keyword to get started.
  2. If you want to bang your head against this, use the Designer, that at least tells you about the worst syntax errors etc. If (if!) you can even run the bloated thing on whatever hardware you have openhab running.

End of rant.

1 Like

Haha, I feel ya!

I do use the designer, which did not show any errors on the above rules. I definitely have not loved Xtend either, and trying to understand its relationship with Java and when certain classes and commands are allowed vs when they are not.

The jsr223 scripting has definitely been on my radar with an api that seems more complete. I would probably use javascript since I do a lot of that in my day job, but the advice is good either way. Thanks for the tip.

How did you do this? I’m looking to do the same thing

NVM, I had to keep reading

@Bernd_Pfrommer can you please have a look at this question? Insteon Dimmer LamLinc doesn't turn off the light

What did you write in your sitemap for Light_Bedroom_Nightstand_DoubleClick (or basically for items with feature fastonoff)?