Hi is it possible with this blueprint to brighten a light by rotating clockwise and dim counterclockwise? How? Thanks. I see the instruction in post 1, but how to add this??
EDIT I changed the blueprint automation manually, but where to change the script integration?
I donāt know where you pasted that code. I donāt know if there is typo in it because it is a picture.
i can show you exactly where I have this in my configuration.yaml, maybe that will help you. It goes in the script: integration
It is also possible that the lights you are controlling do not have a brightness control.
So Brian and everyone else, St. Nick brings you treats this day. Well, I do, but whoās countingā¦
I have re-Written the back end of this blueprint to use MQTT Based triggering.
Why you might ask?
Well because there were plenty of people that had their Z2M running in HA Legacy mode which is supposed to be the least favored method (but works great for this). There are others of you that are running Z2M in non-Legacy mode (which looks painful to implement). But everyone has the MQTT Trigger mode available regardless of how you have your triggers set. So rather than excluding anyone, thatās what I used.
As a special bonus, on my system anyway, it responds faster.
As a special treat this blueprint created itās own number entity to store the last_side variable which the legacy mode did for me before, now I have to do it, but for those of us that are geeks out there you can see how to generate a number entity using MQTT Discovery for your own needs should you need it.
Feel free to ask questions.here. If you found a bug please add it to Github as an issue so I can take care of it.
Please Click the at the end of the Top Post if you find this Useful
There are always null triggers.
Z2M usually has a wake-up trigger, then the actual trigger, then a null trigger on every action. (sometimes moreā¦)
Thatās why the condition is there to only act on real actions & avoid log spam.
Look thru other triggers and see if the action shows in one of those.
In the second screenshot, I showed that the topic is specified correctly)
There are two errors in the system logs
Logger: homeassistant.components.automation.cube
Source: helpers/script.py:409
Integration: ŠŠ²ŃŠ¾Š¼Š°ŃŠøŠ·Š°ŃŠøŃ ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: 6 Š“ŠµŠŗŠ°Š±ŃŃ 2022 Š³., 18:10:21 (36 occurrences)
Last logged: 6 Š“ŠµŠŗŠ°Š±ŃŃ 2022 Š³., 18:37:35
cube: Error executing script. Error rendering template for variables at pos 1: TemplateError: str: Must provide a device or entity ID
Logger: homeassistant.components.automation.cube
Source: components/automation/__init__.py:572
Integration: ŠŠ²ŃŠ¾Š¼Š°ŃŠøŠ·Š°ŃŠøŃ ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: 6 Š“ŠµŠŗŠ°Š±ŃŃ 2022 Š³., 18:10:21 (36 occurrences)
Last logged: 6 Š“ŠµŠŗŠ°Š±ŃŃ 2022 Š³., 18:37:35
Error while executing automation automation.cube: TemplateError: str: Must provide a device or entity ID
Just to double check everything, I deleted the copy on my HA instance, I pushed the download blue button in the top post here, installed it, built a tap action, and it worked, no log errors. I need to see your automation if I am to find anything further.
Can you post that to me in a personal message here or on my discord? I will help you troubleshoot further.
Updateā¦Later that Eveningā¦
I found a place where non ASCII characters could effect the friendly name, so I added a filter and I increased the HA rev requirement in case that was causing an issue.
You may want to try it again, maybe I found it. I donāt have a way to know as it works here.
December 11, 2022 > Update. Added Device Tracker Blueprint to the list.
2022-12-12: Add Update Method Note, minor code change.
Name of Blueprint may have changed meaing you have to re-download with a new link.
If name changed, it is similar. Variables have not changed.
OMG! I just realized that you updated your blueprint! This is wonderful. Iām so grateful to you. It works perfectly.
Thank you so much
I do have one error, though, in configuring the example you have of rotate for dimmer control. I havenāt spent much time digging into it. I get this error in the logs when the action is triggered:
2022-12-19 15:40:41.036 ERROR (MainThread) [homeassistant.components.script.cube_dimmer_control] cube_dimmer_control: Error executing script. Error for call_service at pos 1: Error rendering data template: TypeError: canāt multiply sequence by non-int of type āfloatā
I assume this refers to the variable: angle. I tried replacing {% set step_size = angle * 0.4 %}
with {% set step_size = (float(angle)) * 0.4 %}
which also failed ā Iām sure I have the syntax wrong. Maybe the value isnāt being passed correctly, however?
EDIT: I changed the line to: {% set step_size = float(angle) * 0.4 %}
and got this error:
2022-12-19 23:16:26.407 ERROR (MainThread) [homeassistant.components.script.cube_dimmer_control] cube_dimmer_control: Error executing script. Error for call_service at pos 1: Error rendering data template: ValueError: Template error: float got invalid input āā when rendering template '{% set step_size = float(angle) * 0.4 %}
So, it looks as if the value of āangleā isnāt being passed at all from the template in the automation:
Hmm.
Iāll have to see what I have different on mineā¦
OK. I have left legacy stuff on. When I look at MQTT-explorer the topic zigbee2mqtt/yertle (which is the cube name and is the topic Iām using to grab the changes) has the angle as an attribute. I see it, mine is working.
What are you seeing?
What topic are you using?
If you are using the equiv of zigbee2mqtt/yertle/action, that wonāt work.
I looked in mqtt explorer and see the mqtt messages showing it working for shake, tap etc. I also see the home assistant actions showing the expected actions. Thereās some issue with the blueprint that home assistant doesnāt like and throws those errors in the log.
Whatās your cube model or firmware and version / type of Z2M. If I need to change it I can, trying to figure out exactly why, however. I also have action_angle, but was weird about using it because it goes to null sometimes. Maybe itās right when it needs to be, but that would need to be tested.
My cube reports as: MFKZQ01LM
Iām not sure how to extract the firmware version.
Z2M running in HASS, directly installed on Raspberry Pi with Sonoff 3.0 USB dongle:
I changed this specific setting in Z2M settings for the cube (it was un-set before):
And suddenly, I get this:
Success! I guess I should leave all the other Legacy things enabled as well? Everything seems to work with my other Zigbee devices.
I deleted everything and started fresh and changed the name in z2m to one with no spaces and it all works. Thanks for the help and man what a great blueprint I really appreciate it!