Aws and same topic for more device
Bobsilvio opened this issue · 6 comments
i'm using aws to connect two or more PC, in order to turn them on and off, so i created a virtual device. The problem is that in the same topic, when I switch on, all the devices are switched on also on alexa are called Device1 and device2.
There is a method to identify devices and direct requests, in the same topic.
@Bobsilvio I'm a little confused with how you are implementing it, but you should be able to publish different messages depending on which device you want to turn off. Everything subscribed to a specific topic will receive all messages published to it so the message text needs to be different. If you are still having problems please provide a minimal code sample with what you are trying to do.
ok thanks I would like to know one last thing.
if I give a message from "AA":
myMQTTClient.publish ("myTopic", "myPayload", 0)
and I await the answer from "BB" in a second topic
myMQTTClient.subscribe ("myTopic2", 1, customCallback)
how do i print the response
I'm assuming that you are using the basicPubSub.py when I wrote this answer. To print the response all you need to do is add flush=True to line 32. This only works in python 3.
print("--------------\n\n", flush=True)
Also you can set logging to only show errors on line 82. This prevents the console from being cluttered with all to the debug lines.
logger.setLevel(logging.ERROR)
I use https://github.com/thehappydinoa/AshsSDK, that it uses aws iot.
The purpose is to make alexa recognize virtual devices, let's assume that the skill is public to the user, everyone will read from the same topic, so I'm trying to retrieve the mac address of the devices. Even sending a correct answer does not find the device (perhaps a matter of time, or return)
Could you include more details of what you are trying to do? If your problems are with guide that you linked you might have better luck asking for help there.
Greetings! It looks like this issue hasn’t been active in longer than a week. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one, also please try V2 as this might be solved there too.