Insteon RemoteLinc 2 Lacks the Heartbeat Feature?

A heartbeat is a simple broadcast packet sent at a predetermined interval.  The purpose of the packet is to announce to everyone that the device “is still alive.”

The Insteon RemoteLinc 2 is a battery powered insteon remote, that remains in a sleep state when it is not sending messages.  In this state the remote does not listen or respond to any packets sent to it.

As a battery operated device, the remotelinc will eventually need to be recharged, and it would be nice to know when a recharge is needed rather than finding out when the device doesn’t work.  The remotelinc has a command to query the battery level, but this query won’t work if the device is asleep.

This is where a heartbeat message would be nice.  It would automatically wake up the device at a periodic interval, allowing a battery level request to be sent to the device.

Best I can tell, the Remotelinc heartbeat function has been disabled or not included.  The following settings are supposed to control the hearbeat function:

Awake Interval Sets the amount of time the Remotelinc remains awake with no activity. This is editable
Sleep Interval Sets the amount of time the Remotelinc remains asleep, before waking up to send a heartbeat message. The device ACKs my changes, but the settings on the device don’t change.
Broadcast Number Sets the number of heartbeat messages that should be sent every time the sleep interval expires. The device ACKs my changes, but the settings on the device don’t change.
NoIAmAwake Bit A single bit to disable sending heart beat messages, presumably overrides all of the other settings. The device ACKs my changes, but the settings on the device don’t change.

Other users have reported similar problems over at the Indigo support forum.

As a work around, Misterhouse will send a battery level request immediately after receiving a message from the RemoteLinc.  The RemoteLinc will stay awake after sending a message for the amount of time specified in Awake Interval, I set mine to 10 seconds. Battery level requests will only be sent if the amount of time since the last battery level response has exceeded a defined threshold.

All of this works well, except for rarely used devices.  It is possible that such a remotelinc could die without there being a chance to query its battery level.

Posted in Home Automation | Leave a comment

Insteon All-Link Control Flags

For whatever reason it is difficult to locate the breakdown of the Insteon All-Link Control Flags.

Link Control Flags:
Bit 7: 1 = Record is in use, 0 = Record is available
Bit 6: 1 = Controller (Master) of Device ID, 0 = Responder to (Slave of) Device ID
Bit 5: 1 = ACK Required, 0 = No ACK Required (currently always set to 1)
Bit 4: Reserved
Bit 3: Reserved
Bit 2: Reserved
Bit 1: 1 = Record has been used before (‘high-water’ mark)
Bit 0: Unused

Posted in Home Automation | Leave a comment

Insteon All-Link Cleanup Failure Report Documentation Error

Insteon All Link Cleanup Failure ReportThe documentation for the Insteon PLM defines an All-Link Cleanup Failure Report as being 7 bytes long with the 3rd byte being a useless 0×01.

In fact, command 0×56 is actually only 6 bytes in length.  The 3rd byte listed in the documentation does not exist.

Posted in Home Automation | Leave a comment

PHP: Get date for nth occurrence of weekday

I looked quickly and did not see any code out there to determine the nth occurrence of a specific day of the week in a month.  For example Thanksgiving is the 4th Thursday in November.  So I designed the following

<?php
$year = 2012; 
//Pick your year
$interval = 4; 
//Week number, in this case the 4th week
$dayofweek = 4; 
//Day of week 0=Sun, 1=Mon. . .
$month = 11; 
//Month 1=Jan, 2=Feb

$firstday = jddayofweek(gregoriantojd($month, 1, $year), 0);
if($firstday <= $dayofweek){
  $date = (($interval * 7)-6) + ($dayofweek - $firstday);
}else{
  $date = (($interval * 7)-1) + (6 - $firstday);
}
echo date("n/j/Y", mktime(0, 0, 0, $month, $date, $year));
?>

It looks a little messy, but it works perfectly.

 

UPDATE:

So apparently as bad as this looks it works too:

Continue reading

Posted in Programming | Leave a comment

Integrating Google Talk with Roundcube

Sorry I don’t have much time at the moment to write up a whole entry about this, but I am very excited about this.

I am a big fan of roundcube but I have always wanted the ability to integrate some instant messaging into it.  Well google finally released a gtalk gadget that allows you to integrate gtalk/gchat into any page you want.  Although, google has done a very poor job of announcing this and I don’t think most people know about it.

Anyways, it is a very simple single line <iframe> code.  I just quickly added it to the roundcube template and made a few changes to the CSS code and it works perfectly.

Click the image above to see a larger screen shot.  I will write up the code for this later when I have some free time.

Posted in Programming | 1 Comment

How to Resurrect Procmail and Spamassassin on Dreamhost

Admittedly I have been very annoyed with Dreamhost since they announced that users would no longer be able to use procmail.

How to get procmail Back

After reading the most recent entry I realized that it is possible to still use both procmail and spamassassin.  However, this solution is not elegant.

Currently Dreamhost has a rudimentary Mail Filter system that is accessible by all mail users.  This system is due to be upgraded soon.  Dreamhost also allows regular shell users to access and run procmail as well as spamassassin.  In fact, shell users can install their own custom install of spamassassin.  Lastly, shell users can also receive email, although there is no imap or pop service for this mail.

Continue reading

Posted in Programming | 3 Comments

Bug in BlackBerry Repeat Rule, MONTH_OF_YEAR Deincrements 1 Month

I have noticed a bug in javax.microedition.pim.RepeatRule, when I tried to set a an event to repeat every second sunday of may I would get an event that repeated every second sunday of april. I determined that this was being caused by MONTH_OF_YEAR being deincremented by 1 month after the event was committed.

I worked around the problem by setting the value one month forward. However obviously, this does not work for december. I tried increasing the value of the MONTH_OF_YEAR setting, however java balks at any unknown value. Currently I am unable to set an event to occur on the second sunday in december. If anyone figures out a work around I would be greatful.

RIM has recognized that this is a bug, but who knows when the bug will be fixed. I attached a copy of the email I received from RIM:

Continue reading

Posted in Blackberry, Programming | Leave a comment

Improved Funambol Blackberry Plugin

As promised I made significant improvements to the Funambol Blackberry Client, while the improvements are geared towards better functionality with ScheduleWorld.com, they should benefit individuals who use other SyncML servers as well.

The Improvements in 3.0.8.4 include:

  • Ignore milliseconds in date, fixes duplication on
    slowsync
  • Properly display entities such as quotes and ampersands
  • Allday events now show up on week and month view
  • Multiday Allday events are no longer short one day
  • All day events no longer duplicate on SlowSync
  • Accept basic ISO 8061 dates
  • Fixed error message that popped up whenever sending an email
  • Removed configuration section relating to email since Schedule World does not support email
  • Altered default settings in configuration to match Schedule World settings
  • Added AutoSync Feature - The client will query the server for changes every X hours.

Continue reading

Posted in Blackberry, Programming | 5 Comments

Fix for Sending Email with Funambol and Schedule World

Those of us without a Blackberry Enterprise Server cannot automatically synchronize our calendar and contacts with our PC without directly pluging the Blackberry directly into the PC with a USB cable. This is where Funambol and ScheduleWorld come in. ScheduleWorld is a SyncML server, basically a Calendar and Contacts server. Funambol is an open source SyncML client for the blackberry. By using both of these programs you can sync your calendar and contacts to your PC over the air, without directly connecting your Blackberry to your PC. There are numerous tutorials for how to set this sytem up so I won’t waste your time discussing it here.

However, the Funambol ScheduleWorld setup has had one main issue for over a year. The problem stems from the fact that Funambol also allows for the synchronization of email while ScheduleWorld does not. Funambol allows users to unselect mail from synchronization. But even with mail unchecked Funambol still does some check of the mail which causes an error. Currently users will get the following error when sending an email:

Sorry you can't synchronize "mail", because the name of 
the Remote Mail in the Funambol configuration panel
mismatches the corresponding name on the server.

Users then had to select "resend" to force their email to send. Needless to say the whole process was very annoying. Funambol is an open source project so I decided to take a look.

Continue reading

Posted in Blackberry, Programming | 1 Comment

Blackberry IMAP Proxy – Working Sent and Trash Folders

RIM has never fully supported IMAP servers in their Blackberry Internet Service(BIS) formerly Blackberry Web Client(BWC). Notably BIS does not recognize the NAMESPACE command from IMAP servers. The vast majority of IMAP servers place all user folders in a single parent folder(usually INBOX) therefore the Sent and Trash folders are actually INBOX.Sent and INBOX.Trash. Unfortunately BIS only recognizes Sent and Trash in the base directory.

This script sits between the BIS and your IMAP server. The proxy then makes INBOX.Sent and INBOX.Trash appear to be Sent and Trash. This enables BIS to save a copy of your sent emails into INBOX.Sent properly and a copy of deleted emails into INBOX.Trash properly.

Additionally this script allows you to use a non standard folder as your inbox as well.

Continue reading

Posted in Blackberry, Programming | 10 Comments