so yeah a custom component. (its a custom addon, which is created by a third party and what uses autodiscovery from home assistant)
i didnt mean to search for button event, but for anything what could be related to the magic cube.
does the usb-zigbee/phoscon create any entities?
maybe something called switch.15 or are there any other entities that you have no idea about where they come from?
do you know anything about how to write apps? because the code you provide shows that you dont know how to work with appdaemon. (and thats no shame, we all need to start learning at some point, when we start with something new)
this code:
def initialize(self):
self.log(self.listen_state(self.cube_rotate, "changed"))
def cube_rotate(self, event_name, data, kwargs):
self.log(data)
self.log(event_name)
self.log(kwargs)
can never have given you this result.
2019-01-13 13:56:04.103949 INFO xiaomi: {'id': 'mi_magic_cube', 'event': -5539}
2019-01-13 13:56:04.107696 INFO xiaomi: deconz_event
2019-01-13 13:56:04.108289 INFO xiaomi: {}
because first of all you cant use
self.log(self.listen_state(self.cube_rotate, āchangedā))
it will start a state listener if you have a decent callback, and log a handler (a number)
but it wont log a number at all because your callback is for an event listener, so it only generates an error in your errorlog.
above all it cant give any return because listen_state listens to entities and āchangedā isnt an entity
so only that line alone has 4 different points where you go wrong.
the info you have in the log must be from something else you have done.
i think thats from self.listen_event(self.cube_rotate, āchangedā)
i suggest you first try to learn how to create apps, and try to understand what listen_state and listen_event (and all other functions) do, before you try to something like this.
this could be helpfull to understand what you are doing:
my appdaemon for beginner:
how to write apps from the docs
https://appdaemon.readthedocs.io/en/latest/APPGUIDE.html
the list of available functions from AD
https://appdaemon.readthedocs.io/en/latest/AD_API_REFERENCE.html
the specific functions for home assistant
https://appdaemon.readthedocs.io/en/latest/HASS_API_REFERENCE.html
besides those info, it is always important to look at normal log and errorlog.
at the moment you know what you are doing, you could try to listen to the event with the name ādeconz_eventā
if there is anything that you dont understand from my tutorial or the docs i will gladly explain it some more for you.