I’m having some trouble to automate the Xiaomi aqara [MFKZQ01LM] cube with zigbee2mqtt (https://www.zigbee2mqtt.io/devices/MFKZQ01LM.html).
Try to launch different light scenes depending on the cube action. What should I do to make it work (currently automation does’nt react).
However, I invite you to take a look to ControllerX an AppDaemon app that handles controller events and lets binding them to lights, media players and call services.
This would be the configuration in apps.yaml for your needs:
Could I use the “CustomLightController”? Should I use the “MFKZQ01LMLightController” class instead? What’s the difference. By the way these 2 generate an appdaemon error like this:
2020-03-20 13:43:05.154329 INFO AppDaemon: Initializing app cube_bedroom using class CustomLightController from module controllerx
2020-03-20 13:43:05.302952 INFO cube_bedroom: ControllerX v2.4.3
2020-03-20 13:43:05.311740 WARNING cube_bedroom: ------------------------------------------------------------
2020-03-20 13:43:05.312472 WARNING cube_bedroom: Unexpected error running initialize() for cube_bedroom
I will summarise in here the differences between the different type of controllers.
CustomLightController: It allows to map the event buttons with predefine actions, such as, turning light(s) on/off, toogle, change color, brightness. Here is an example from the documentation:
This uses the CustomMediaPlayerController which is the same as the light one, but for media players. In this case I am mapping the different events with predefined actions like play/pause, skip song, etc. You can find the predefined actions in here
MFKZQ01LMLightController: This controller is the easiest to configure, but it gives a default behaviour to the cube. This is a configuration example of my current setup:
CallServiceController: This one is the one I used in the example I gave you. This allows to bind the events to HA service calls.
I hope this helps you clarify the options you have.
Regarding the error you are getting, I might need more information, since the error itself is not described in the section you showed. Could you maybe send all the AppDaemon logs?