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: MH Should React to AllLink Broadcast Messages #153

Closed
krkeegan opened this issue Apr 5, 2013 · 2 comments
Closed

Insteon: MH Should React to AllLink Broadcast Messages #153

krkeegan opened this issue Apr 5, 2013 · 2 comments
Assignees
Labels

Comments

@krkeegan
Copy link
Collaborator

krkeegan commented Apr 5, 2013

Currently MH ignores the AllLink Broadcast message knowing that a direct-cleanup message containing the same information will arrive shortly thereafter. Unfortunately, the direct-cleanup messages are lost sometimes. Moreover, in a large scene, it may take many seconds for the direct-cleanup message to arrive and so it may be preferable for MH to react to the broadcast message to be more "in-sync" with the timing of things.

Some consideration should be given to preventing duplicate calls to set the state of the device. Perhaps a flag that tracks the time when an alllink broadcast message is received and if a matching direct-cleanup message is received within a specified number of seconds no subsequent call to the set routine is made?

@ghost ghost assigned krkeegan Apr 5, 2013
@mstovenour
Copy link
Collaborator

I think the code for processing the second event (i.e. direct-cleanup) could just compare the current state to the new state and only update if the two do not match. Effectively “state” is the flag you describe.

@krkeegan
Copy link
Collaborator Author

krkeegan commented Apr 7, 2013

I thought about that, but it would create the possibility of a quirk.
Normally pressing the 'on' button on a device would still set state_now
for one loop even if the light was already on. But, if the broadcast
message was missed, state_now would not be set. Maybe I could check the
idle_time and if it is less than __ seconds we assume a broadcast was
received?? However, really large scenes could take many seconds to complete.

So two options:

  1. Accept an strange anomaly in what seems like a rare case
  2. Add yet another flag

Neither are ideal, what do you think?

On Sun, Apr 7, 2013 at 7:06 AM, Michael Stovenour
[email protected]:

I think the code for processing the second event (i.e. direct-cleanup)
could just compare the current state to the new state and only update if
the two do not match. Effectively “state” is the flag you describe.


Reply to this email directly or view it on GitHubhttps://github.com//issues/153#issuecomment-16015646
.

krkeegan added a commit to krkeegan/misterhouse that referenced this issue Apr 12, 2013
Fixes issue hollie#153

The set routine is now called when a broadcase message is received.  The flag _pending_cleanup is also set.

When a Direct Cleanup Message is received, if the state of the device matches the pending state and the _pending_cleanup flag is set, we assume that this command was already processed.

This code is all adjacent to each other, so using a flag should not be confusing.

Much of the code was already there, but was commented out by Gregg in his first commit of the new insteon code.  This initial commit included a huge number of changes and no notes were added as to why this was disabled in the redux.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants