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

Support 5+ year old devices #17

Closed
TD22057 opened this issue Dec 23, 2017 · 9 comments
Closed

Support 5+ year old devices #17

TD22057 opened this issue Dec 23, 2017 · 9 comments

Comments

@TD22057
Copy link
Owner

TD22057 commented Dec 23, 2017

See Issue #14 for some details (from @mwdng). Old devices don't respond to the refresh command properly. It may be that they need a standard cmd, not an extended one.

@krkeegan
Copy link
Collaborator

krkeegan commented Mar 9, 2018

I have a bunch of i1 devices so I am more than happy to try and tackle this. This will have to go in stages.

My first issue is, in order for this to work, we need to know the "engine version" of the devices early on. This is a trivial get_engine_version 0x0D standard command.

My first question is, should we send this command and retrieve this information on the device config load, in from_config(), should we wait until we try and send a message that requires knowing the engine version, or should this be an affirmative command sent by the user?

@TD22057
Copy link
Owner Author

TD22057 commented Mar 9, 2018

Off the top of my head, I'd say something like:

  • add this as a field to the device database (device.Db) and add it to the to/from json conversions
  • add a method in device.Base to send this request and process the response by setting the value into the device db
  • in the device refresh() command, if this field isn't set, send the command to get it

We know refresh has to be called at least once to get the link database so things work. This would insure that the engine version is only requested one time per device. After that, the devices can use it to switch behavior by looking at the field in the database.

@krkeegan
Copy link
Collaborator

krkeegan commented Mar 9, 2018

awesome that is exactly what I needed, thank you

@krkeegan
Copy link
Collaborator

krkeegan commented Mar 9, 2018

Alright, I made a pull request for this stage.

I do think that refresh is a good place for this. But the one thing to note, is that at least in the instructions, when adding a new device we will need to add a step for refresh before linking.

@TD22057
Copy link
Owner Author

TD22057 commented Mar 9, 2018

Then this approach isn't going to work. You can't refresh before linking. The device won't accept commands from the modem until it's linked.

@krkeegan
Copy link
Collaborator

krkeegan commented Mar 9, 2018

Hmm, ok the alternative is to force a get_engine request within the linking command if the engine version is not known.

@krkeegan
Copy link
Collaborator

I have added support for writing link entries using the standard messages required by i1 devices. It is in branch https://github.com/krkeegan/insteon-mqtt/tree/WriteDBForI1, I am going to wait on submitting a PR as many of the PRs and branches are overlapping.

I think this concludes the necessary improvements to close this issue when merged.

@TD22057
Copy link
Owner Author

TD22057 commented Jul 7, 2018

I believe this is now fixed w/ the merge of your PR's. Let me know if that's not the case.

@TD22057 TD22057 closed this as completed Jul 7, 2018
@TD22057
Copy link
Owner Author

TD22057 commented Jul 7, 2018

For completeness, that was PR #72, #41, and #40.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants