hollie/misterhouse — pull request #399 by krkeegan (2014-04-18 05:07:47+00:00)
Title: Insteon: Improve Support for Deaf Devices; Add Delete Orphans Capability

The management of deaf devices such as motion sensors and remotelincs has always been a little weak in MisterHouse. The problem is these devices must be "awakened" before MisterHouse can speak to them. Normally we wake devices by pressing the set button for 10 seconds. This leaves the device awake for about 4 minutes.

However, these devices also remain briefly awake immediately after then send a command, this seems to last about 2-4 seconds, although with some devices this awake time can be modified and extended.

Due to this "awake" requirement, MisterHouse ignores these devices when performing batch actions (Sync All Links, Scan All Device Tables, Delete Orphan Links). Generally, the user could manually awaken the device and call the device equivalent command to achieve the same results. However, there was no device equivalent "Delete Orphans" which meant there was no way to remove extraneous links from deaf devices without resetting them. Additionally, it was often annoying to be forced to manually place a device in awake mode.

This branch solves all of these issues.
- __ALL__ commands sent from MisterHouse to deaf devices are now "queued" and will not be sent until the device is awake.
- MisterHouse recognizes that a deaf device is briefly awake immediately after receiving a command from the device. If commands are queued, MisterHouse will attempt to send those commands at this time. As long as MisterHouse continues sending commands, the device will remain awake. As a result, you can queue a Scan to run on a motion sensor, and the scan will be performed the next time you walk past the sensor.
- You can still place the device in "Manual Awake Mode." In fact, if you enable monitor mode on the PLM, MisterHouse will now recognize when this happens and will treat the device as awake for four minutes. If you do not have monitor mode enabled, you can flag this "Manual Awake State" using a voice command on the device.
- The ability to enable/disable monitor mode has been added to the PLM's voice command list. I have not
noticed any downside in enabling this feature.

Everything appears to work well in my setup. However, keep in mind that deaf devices are one of the most difficult devices to communicate with since they are RF only, so you many encounter some issues trying to maintain a sustained conversation (such as scan links) without moving them closer to an access point or other dual band device.

Fixes hollie/misterhouse#183 & hollie/misterhouse#182