Retrieve device IDs in the Jovo Request


#1

Similar to @Andrea’s question: Does/can the Jovo request carry any information about which of the user’s devices responded to it?

I’m adding a “what are we listening to” function to my player. It’s working pretty well as long as the user only uses the skill on one device at a time. If they’re making requests from several, my simple activity flag gets confused. I could turn it into a counter, but counters are fragile when you can’t be absolutely sure there isn’t a failure case which causes decrement to be missed. And there’s the risk that the user has asked me to play different things on different devices. So I may want to be able to record the user context not just as this.$user.data.*, but this.$user.data.device[id].* or something like that.

Is device ID exposed at all in the Jovo object passed to the handler? Or does the $user.data key (“S”) already identify device? (That would present its own complications if user tells the bedroom device to “stop playing in the living room”, unless the handler gets a stop event from the latter device.)

The failure modes in my current solution aren’t awful, I’m just poking at edge conditions because I know someone (probably me) will run into them eventually.

(Device ID is certainly present in the lambda’s logs, so Jovo is getting it… question is whether it’s passed through to the developers in a vaguely portable way, and whether you’re willing to promise that it will continue to be available.)


#2

You can access the request and all its properties with this.$request.

In v4, you can access the device id with this.$device.id.