Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insteon: Improve Support for Deaf Devices; Add Delete Orphans Capability #399

Merged
merged 13 commits into from
Apr 26, 2014

Conversation

krkeegan
Copy link
Collaborator

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 they 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 #183 & #182

-_process_command_stack is in BaseObject, which requires is_awake to be there too, otherwise we get errors with InterfaceObjects
-Fix stupid error s/$self/$object/ in BaseInterface
This is needed in order to allow for delayed scanning of deaf devices.

As a side effect, it makes the code much more condensed and readable.
- Add log message explaining what is happening
- Send command to scan each deaf device individually, this should result in the requests being queued, unless the device is awake
- Because these commands will be fired off when the various devices are randomly awake, these have to be individual "uncoordinated" scans.  In the worst case scenario, this will cause the scanning of numerous devices to happen at the same time.  While not ideal, this can't simply be avoided, however, the stack should be robust enough to handle this without error now, although it may be confusing to the user.
Sync these links when the device wakes up

Also clean up Sync_All_Links routine a bit
- On further thought, including deaf devices in batch commands is a bad idea.  Many deaf devices are rarely contacted, yet a user may run the batch commands frequently.  This may result in a TON of queued messages for a deaf device, which may result in too much traffic when the device is finally contacted.

- The better course of action seems to be to force users to run these same commands on the specific deaf devices.
Using Delete Orphans on a single device is not generally advisable.  Delete orphans works on the device level and not the link level, meaning it only cleans up a specific device, which may result in "half-links"

Now, this shouldn't be too much of an issue for deaf devices as the batch command of Delete Orphans will allow "half links" to be created by deleting responder records from deaf devices.  As a result, the command on a deaf device will simply clean up the half links.  (I hope that makes sense)
Since batch commands will not work on deaf devices, needed to add two AUDIT commands

Also add a Delete Orphans command
Enabling Monitor Mode has other benefits.  Adding it as a voice command option.

Adding POD documentation for voice commands.
krkeegan added a commit that referenced this pull request Apr 26, 2014
Insteon: Improve Support for Deaf Devices; Add Delete Orphans Capability
@krkeegan krkeegan merged commit d0eca12 into hollie:master Apr 26, 2014
@krkeegan krkeegan deleted the fix_issue_183 branch June 13, 2014 23:56
jsiddall added a commit to jsiddall/misterhouse that referenced this pull request Dec 10, 2020
Insteon: Improve Support for Deaf Devices; Add Delete Orphans Capability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants