Magic Cube Zigbee2mqtt and Side Conditions

I came here to ask how to fix this issue I was having, but I fixed it myself. I thought I would post incase it can help someone else.

I have an Aqara Magic Cube connected to HA with zigbee2mqtt. Everything was working except for automations that included conditions on which side of the cube was activated. I read several other posts with similar problems, but none were quite what I was struggling with. Taking away the condition made the automation work, adding it back in nothing would happen.

My first fix was changing the condition from state to numeric state. With numeric state, for example if I wanted side 2, I would have to say above 1 and below 3. A little hacky but it was working as intended, I could have different tap actions triggered depending on the activated side.

I felt like this wasn’t quite right, so I kept looking into it, and like I said, I was about to post here asking about it.

I found one more topic that had some slightly different info, and it made me think to look at something in the yaml of the automation (up to that point I was mostly using the HA UI, I did try a template condition that I saw someone else using, but that didn’t work, although I’m sure I could have got it working if I played with it more).

When I looked at the yaml, the state in the condition was ‘0’ which wasn’t working. I took out the quotations marks, and then it worked.

I don’t know if this is a bug or what, but I feel satisfied to finally figure it out.

2 Likes