Closed pvint closed 3 years ago
@HiddenVision
I normally just handle this in my code, example:
for (int i = 0; i < 8; i++)
{
ESP_LOGI(TAG, "Adding fauxmo device %s %c (%d)", deviceBasename, i + 49, i + 49);
snprintf(d, 15, "%s %c", deviceBasename, i + 49);
// TODO - get these from flash
strcpy( deviceName[i], d);
fauxmo.addDevice(d);
}
It might be worth thinking about adding an option to do this automatically in the future, however.
So if you program multiple devices with the same binary will they all have unique names? That was the point of the initial post. I am fully sorted by the added code I suggested so no need for me to add anything new.
I suggest renaming the issue so we can help find a permanent solution for everyone about the same...
So if you program multiple devices with the same binary will they all have unique names?
Yes. As of a6c0300580a6d570c4d677d8252e990338c213b9 the uniqueid is generated based on a hash of the device's MAC and the name you give to the device.
Original report by HiddenVision (Bitbucket: HiddenVision, GitHub: HiddenVision).
Just a quick thought after getting things to work on My Gen 3 Dot.
Many thanks to @Arpad for his thoughts and Json extracts, worked first time.
I edited the Library so that the name I pass is automatically prep-ended with the Device ID.
I found that programming multiple devices with the same code led to confusion (on my part) as all the names were the same. Obviously the usable name can be edited in Alexa app.
Just thinking this is a cute mod for someone to add into the core code.
I admit I am using EspAlexa Library but I think the logic stands for most Alexa libs.
Example line
For example I set the name to “Socket_” or “Light_” and end up with a unique name for every device programmed.
I suspect there is a better method but this worked first time round so I left it be.
Sorry if this upsets anyone.
Hv..