The guys who manages deconz implemented the possibility to use each side of the xiaomi cube as it’s own event, this is really nice but also a hassle since it takes some really long automations to trigger correctly if you dont want to use the sides for individual automations.
These are the event ID’s available for each move you can do with the cube.
x000 for push, so 1000, 2000, 3000, 4000, 5000, 6000;
x00x for double tap, so 1001, 2002, 3003, 4004, 5005, 6006;
x00o for 180° flip (where o = 7 - x), so 1006, 2005, 3004, 4003, 5002, 6001;
x00y for 90° flip (where y ≠ x and y ≠ 7 - x), so 1002, 1003, 1004, 1005, 2001, 2003, 2004, 2006, 3001,
3002, 3005, 3006, 4001, 4002, 4005, 4006, 5001, 5003, 5004, 5006, 6002, 6003, 6004, 6005;
7007 for shake.
7000 for wakeup (the cube sends raw value 2 when I just tap it after a while).
So for the Push I need 6 triggers, double tap 6 etc, but the 90° needs 24 triggers. I’ve been searching the forum for any way to use a value_template trigger instead, but the issue I have is that I cant understand how to format it since the cube works on the “event” platform, not “state”.
This is what an automation looks like with 1 trigger
automation:
- alias: Cube Home Theatre - tap_twice - Power on
initial_state: True
trigger:
- platform: event
event_type: deconz_event
event_data:
id: hemmabio_kub
event: 1001
action:
service: script.home_theatre_on
And i would like it to work like this example, but with several if statements and on the event platform.
Anyone who can give me a push in the right direction? I’ve googled and searched the forum for everything that I see even remotely close to what i want.
Maybe it’s time for me to go into the world off Appdaemon then… Been holding of since everything i’ve wanted to do so far has been possible with HA’s limits.
Well there is supposed to be built in python automations built in to HASS as well. But I haven’t delved into how those work. Might be sufficient for you
Sorry for once again awakening this thread but, just to be sure of the logic. Your automation trigger calls for any event from the cube and the condition defines what events to include for the specific action right?
Nice to see that people contribute with their findings, I actually migrated my config to node-red shortly after my initial post. But this might be of use for someone else so please share your code
Mine is much more “simple” (stupider) and uses a switch to parse the ID from the cube.