alexa-samples / alexa-smarthome

Resources for Alexa Smart Home developers.
https://alexa.design/smarthome
Other
680 stars 336 forks source link

How to fudge/clone multiple friendly names for the same physical endpoint #142

Closed RajputAmit-17 closed 9 months ago

RajputAmit-17 commented 4 years ago

how to fudge/clone multiple friendly names for the same physical endpoint. Basically I have one device that has Alexa.PowerController interface on all 6 switches. my main concern is I don't want to create a separate endpoint for all 6 switches in IoT core. is there any way to create a fake endpoint or fake friendly name for the same physical endpoint. So my discovery process loops over each actual device and deep-copies the endpoint data. @mikemaas-amazon @DZhang87

matwerber1 commented 4 years ago

Hi Amit - happened to see your question while browsing... see below for my unofficial thoughts, would still defer to Alexa team for an official answer.

Anyway, If I'm reading the docs correctly, Alexa.PowerController is designed to have a 1-to-1 mapping with an Alexa Smart Home device. However, Alexa.ToggleController can have a many-to-one relationship with your device. According to the docs:

An endpoint can support multiple toggle controllers, so you must always include the instance attribute for a toggleState property. You identify your instance names in your discovery response.

https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-togglecontroller.html

Would this work for you?

aszk commented 9 months ago

You could do the way matwerver1 explained however this is not recommended. You should have different endpoints for each device.