Expire binding and Insteon binding for one Item?

insteonplm
expire
Tags: #<Tag:0x00007fd30e7f7770> #<Tag:0x00007fd30e7f7630>

(Crxporter) #1

I have a lot of free time at work today so I’m doing some “cleaning up” of my rules and items. I’ve just discovered the Expire binding and would like to replace many timers with this new discovery.

My question is whether the following item would work:

Switch bathFan "Bath Fan" {insteonplm="4b.c4.dc:F00.00.02#switch", expire="8m,command=OFF"}

My insteon is set for 5-minute polling - my question is whether these updates trigger a reset of the expire binding. If they do then I would need to create another “bathFanExpire” item and a pair of rules such as:

Rule "Fan On"
when
    Item bathFan changed to ON
then
    bathFanExpire.sendCommand(ON)
end

Rule "Fan Off"
when
    Item bathFanExpire changed to OFF
then
    bathFan.sendCommand(OFF)
end

I would just test this in my setup but, like I said, I’m bored at work and would like to do a bunch of the rule writing now and just copy it over to my Pi tonight.


(Rich Koshak) #2

Any time the Item received an update or command that is different from the “command=OFF” the timer gets starte/restarted. So if your bathFan gets updated every five minutes, it won’t be until there is a problem and the Item doesn’t receive an update for 8 minutes that it will send the command OFF.

The bigger question though, even though your Insteon is set to poll every five minutes, does it actually issue an update to the Items if the Items are in the same state as the polled value? Many bindings do not and only issue the update if the Item’s state is different from the polled state.


(Crxporter) #3

Right - if the insteon binding just shows a poll (but does nothing if the state hasn’t changed) then I believe the single item insteon + expire binding solution will work.

I just started a download of my logs and will take a look at what I see once that’s done.

Side note - why are my logs so big? Is there a way to limit/clear old logs? Say, after a week?


(Rich Koshak) #4

Logs automatically roll over once they reach a certain size (16 m) by default. And it only keeps the most recent 10 files.

If your files are bigger or not deleting then that points to one of the following:

  • logs are configured in a non-standard way in userdata/etc/org.ops4j.pax.logging.cfg
  • your SD card is failing and when OH tries to rotate the log it’s not actually rotating. I’ve seen this on one of my RPis.

(Crxporter) #5

I’m in the logs - I sent a “group command” which will turn on several items but OH will not be aware until the next poll.

My “openhab.log” file shows the following associated events for the item in question:

2018-07-12 13:16:18.565 [INFO ] [onplm.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 2C.63.64 to level 0
2018-07-12 13:17:36.548 [INFO ] [onplm.internal.device.CommandHandler] - GroupBroadcastCommandHandler: sending ON broadcast to group 19
2018-07-12 13:21:18.566 [INFO ] [onplm.internal.device.MessageHandler] - DimmerRequestReplyHandler: set device 2C.63.64 to level 100

We see here the 13:16 poll for the item, the 13:37 group command (when the group command was sent), and the following 13:21 poll showing the new level.

The accompanying “events.log” file shows:

2018-07-12 13:21:18.589 [vent.ItemStateChangedEvent] - fridgeSmellION changed from 0 to 100

Which appears to be the line that would actually trigger the Expire binding timer if I understand correctly.

Similar items do NOT show in the “events.log” for the normal polls - leading me to believe the double binding approach should work. This is the first time I’ve really dug through my log files so I’m not sure I have everything figured out… I think though that I can safely add the double binding to my insteon items and they should turn off after 8 minutes even with the 5 minute polling…


(Crxporter) #6

Got it. I should have actually OPENED the folder and pulled out the newest file instead of just downloading the whole folder.

Oh well, I got to look at the logs and saw about 40 MB of the same line from when I got some commands stuck in a loop a few weeks ago… :roll_eyes:

You’ve been most helpful as always, Rich - thanks!


(Crxporter) #7

Final answer for future searchers:

I am home, I ran the following switch, and it turned off after 8 minutes as expected, the insteon polling happened twice during that 8 minutes, but did not affect the expire binding.

Switch bathFan "Bath Fan" {insteonplm="4b.c4.dc:F00.00.02#switch", expire="8m,command=OFF"}

In conclusion, the “insteonplm” and “expire” bindings appear to work just fine together.