Bindings that must pair with Thing before controlling?

Hey all,

I am working on a new binding. Will go ahead and say that I am way out of my depth…

However, I already have discovery of devices through UpnpDiscoveryParticipant, so that is neat.

I am doing my best to look at other bindings and figure out answers to my questions, however, would love some help here.

Are there any bindings that require pairing with a device before controlling them? Would definitely like to see how that is handled.

In my particular use case, a pairing request is sent to the TV using JSON, the TV sends a response and displays a PIN on the TV, the user would then have to key the PIN into OH, which would then send the PIN back to TV, generating an Auth key. Once that auth key is returned back to OH, this pairing process would not need to be completed again, as it uses the auth key for all future requests.

Any good examples of this?

Thanks,
John

Edit: Binding is for Vizio SmartCast devices vía this API doc: https://github.com/exiva/Vizio_SmartCast_API/blob/master/README.md

It’s not dissimilar to e.g. weather bindings, requiring the user to sign up outside of OH for a login and entering resulting details into the binding configuration as a one-off exercise.

You could provide a channel to trigger the PIN process, for ease of use?

Presumably you would like to auto store the auth key, not sure how that is done.

Yeah, maybe that is best idea.

  1. User activates “Pairing” Channel that sends the JSON request to the TV
  2. TV displays PIN
  3. User enters PIN in Thing Config file
  4. OH, now seeing the PIN in config, sends that value to TV
  5. TV returns auth token
  6. OH writes auth token to thing config
  7. Now that auth token field is not null, OH ignores PIN

I could see that working for sure. Not quite as elegant as I wanted, but considering how little I know, I’ll take whatever I can get!