I have a CBUS system, which I integrate via Home Bridge and into HA. I’m a new HA user (less than a week) but already I can see it has so much potential to work with my systems. So, the piece above works flawlessly.
What I want to do is trap the level of the incoming CBUS device into HA (0-255 as a dimmer) then be able to tell a script or automation to set another device to the very same level, in this case some Shelly dimmers.
I have looked and excuse my noobness, I’m struggling to see how I can trigger an action to say ‘set the Shelly level to the level of this other device’. This is my most important automation, the critical reason to act to moving to HA. Hoping for some hive mind help.
You can create an automation (using the gui) to trigger on a state change of the incoming device. The action of the automation can call light.turn_on on the target light, with the brightness being specified in a template that refers to the brightness of the incoming light, which is a state attribute.
You can use the states tool in the developer tools to figure out the attribute name, and the templates developer tool to test your template syntax.
Thanks, really helpful and is helping my understanding of how it all fits together. I’ve worked out I needed to change the above (it has a mismatch error, I think because of the homekit2 device) which is a virtual device on the CBUS side which is presented to Homekit, and then through to HA.
Still not there yet, tho. Image below is of the cbus switch, and changing that on the cbus side works as an on, off, or a dimmer value, and that is flowing through nicely to HA.
The Shelly also is working from HA, and I can control and dim through HA.
The two devices work and are being reported correctly in HA, that piece is OK.
What I can’t still do is have the Shelly be triggered with the value of the incoming cbus value.
Here’s the code I’ve got to so far, which doesn’t error when creating in YAML, does anything stand out here as wrong?
In the device states page for the cbus device I see: supported_color_modes:
alias: Test2
mode: single
sequence:
- condition: state
entity_id: light.ensuite_homekit_2
attribute: supported_features **<THIS may be wrong and the problem?**
state: brightness **<and this may be wrong. How do I find the attributes on a device?**
- service: light.turn_on
target:
entity_id: light.shower_light
data:
brightness: '{{ trigger.to_state.state }}'
Show us a screen shot from the Developer Tools > States tool for light.ensuite_homekit_2 so that we can see how to extract the brightness data. (Make sure the light is on)