Also, I cannot test right now, but most likely the Blueprint that I’ve created will work as it is if you select “call a service” as an action for one of the turning sides and then adding the variable as a template in YAML mode:
EDIT on 2022-05-07: Use relative_degrees or trigger.event.data.args.relative_degrees instead of flip_degrees.
I’ve tried both in automations before and prefer the one using degrees as a multiplier. If you set it right, you can get finer control over the adjustment. Low angle = low change in brightness/volume. High angle = high change. Versus a static X% no matter how much the turn angle.
I have 3 of these cubes and they control various thongs like blids, fans, lights, etc. I’m currently using the 51 action blueprint one now, besides geting erros messages in the my log files when I rotate the cube:
Template variable warning: 'dict object' has no attribute 'flip_degrees' when rendering '{{ trigger.event.data.args.flip_degrees }}'
2:24:17 PM – (WARNING) helpers/template.py - message first occurred at 2:24:06 PM and shows up 28 times
just curious what your blueprint does that is better than the 51 action one? I’d be happy to change to this!
Hi @Anto79-ops,
I don’t know which Blueprint you are talking about. Please share the link here and I can try to identify the difference between them.
By the way, this is not a competition between blueprints.
It’s the wrong zigbee flavor, but if you are able to get the angle into my template, this template logic I suggest for angle actions should work for you… (This is a link to the dimmer control section)
At that level, it’s just an action. You would need to pass the angle in. Z2M gives me pos angles for CW and negative angles for CCW, so the template doesn’t change and called script gets used for multiple sensors.
I also provide in there a scheme to set the R, G, & B Colors using rotation, and another section to use a short rotation for a short press and a larger rotation as a long press. These are all template things you can do regardless of the Zigbee flavor as long as you can get the angle out of the Integrations Data Attributes.
its sounds like things are greener over at the Z2M side, in terms of features. I’m slowly building up momentum to make the switch. That’s an impressive blue-print for the cube!
I was about to try Z2M when I got this cube and couldn’t find so much material, but in the end I invested a bit more time to learn a bit more on how to work with events and discovered I can have very similar capabilities with ZHA, with an smoother user experience, so I decided to stay.
Maybe I can help you here… What you want is that Blueprint converted for ZHA?
Sometimes simplicity the best solultion, I can guarantee you that if I start talking about angles to control devices with my wife, she is going to through that cube out the window.
I think in my household, I will be using both your blueprints
From side that were not flip actions was fun. I happened to notice that if you were really careful you could get it into that mode. It is completely impractical, however. Not useful beyond a ‘secret’ way to activate a trigger for something…
I mostly added it so I could say there were over 100 ways to trigger it… (albeit some ridiculous…)
Anything anyone wants to take from my code into their code go right ahead. Attribution is nice but not required…
If someone can think of a tweak for mine suggest away.
Of course any copy of your Blueprint will require giving you the credits.
My point is more that “convert” a Blueprint originally designed to Z2MQTT in a way it can work with ZHA is not a big issue.
And I’m not sharing my Blueprint to compete with other Blueprint. I’m doing this in order to support someone who could have a similar use case that I had. It is a collaboration mindset, not a competitive mindset.
And if someone need help converting an existing Blueprint designed to Z2MQTT into a ZHA Blueprint I can help.
I’m not gonna offer to do the opposite by the simple fact that I don’t have a Z2MQTT environment to run my tests.
Go for it. Glad to share.
I have an old sonoff Zigbee V1 brick that someday I’m going it install ZHA for testing and porting stuff, but It hasn’t happened yet. Maybe late fall. So go right ahead.
Hi @mouth4wa, are you sure about this? I couldn’t reproduce what you are saying and basically the blueprint will use the face info it is receiving from the event.
The face numbering is a but tricky and I believe the best representation I found was this on from this other Blueprint: ZHA - Aqara Magic Cube (57 actions), which is also just using the info received by the event (from the Zigbee integration).