šŸ’” Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

Hello,
Z2M also updated over the night to version 2.0.0 (HA is 2025.1.0).
As I have prepared the configuration, all is good except some automations.
Iā€™m facing exactly the same issue as @beurdy
Iā€™ve also noticed this error that I didnā€™t have previously

Perhaps are we facing a kind of inconsistency with the evolution in Z2M 2.0?

Thanks

Z2M changed the illuminance sensor id, removing the ā€œ_luxā€ at the end. Youā€™ll have to delete the old lux sensor and enable the new one, in each device, then change all the automations that use the old _lux sensor id.

3 Likes

@lukas423

It is a workaround for sure, but for everyone with non working zigbee buttons(including me) due to the sudden change in Z2M, itā€™s a good one, until everything else is sorted. :slight_smile:

Thank you @dreadino, this did the trick :tada:

@lukas423

Re Z2M, I think @dreadino provided the correct solution for this.

No it will break the blueprint. Targets are tricky and I break down everything into their correct domains so the blueprint can handle them. If you have devices then more has to be broken down and possibly filtered out. If you add a device then just expand it down to entities using <> then removing any entities that are not needed and the blueprint will work faster without any problems.

Blacky :smiley:

1 Like

Never mind stumbled across areas vs lights :man_facepalming:

Hey everyone,
quick question, as Ctrl+F was not helpful. I have the automation set to turn on my dinner table lights. However, I often just walk by the table and it turns it on. I would like to delay it so that only if someone is sitting at the table for 3 minutes to perform the automation. Any ideas? I have tried setting a helper and toggling it on and off via automations and then set that helper as the toggle for the automation but to no availā€¦

Thanks a lot @Blacky. At least I can save and use it now. :+1:
Unfortunately I need to find out, how to manipulate the Brightness of the white channel of my Shelly Plus RGBW PM only. It seems, I need to understand controlling it in HA first.

Danny5

1 Like

Create an automation that turns on an input boolean helper, with a state trigger of ā€œpresence at the tableā€ selecting 3 minutes in the bottom left of the trigger card. You should also handle the turn off of the helper. Use the helper as the actual presence at the table for this blueprint.

Hi dreadino,

thanks! I tried that, however, itā€™s not letting me pick the boolean/helper as trigger for the blueprint. The trigger can only be a binary sensor, as it seems. :frowning:

Any ideas?

Hi Blacky!
i have some questions for you:

  1. i have a 4-button switch in Z2M, but i cannot specify itā€™s buttons as a bypass. In Z2M, it seems that it only has a ā€˜actionā€™ entity that tells whether button 1 was pressed or button 3 was held and so on, but i cannot find it or reference it in any way, in HA. I cannot choose the action entity as a bypass either. However, i can choose the automation that controls what the buttons do, but it doesnā€™t seem like thatā€™s the right way to proceed. Is it possible for me to still use that as bypass? If so, please tell :slight_smile:
    From Z2M exposes:
    billede
    From HA:

  2. In my bathroom, i have 2 separate lights that are both controlled by the same automation, one in ceiling and one by the mirror. The ceiling light is bright, so i always set that at about 70% which means that the mirror light is also turned on at 70%, since brightness cannot be controlled individually. The problem is that the mirror light is not too happy about being brightness controlled and will make a high-pitched screeching noise while not being at 100%. How can i control the brightness level of the two lights individually, while still using your automation?

  3. In the Bypass section, you mention that one should not use the same entity in more than one bypass option. I have a shelly relay attached to one of my lights and two physical, spring-loaded switches, effectively only giving me one input per switch (which is toggle). The switches are both connected to the same channel on the shelly relay and both are used for turning on and off. Im not sure how to make the automation understand correctly that i just turned on (or off) the lights manually. Any advice?

Iā€™ve been looking through your documentation, but havenā€™t been able to find answers for these questions. I hope youā€™re willing to help! Thanks for all your time, the effort and your help! :slight_smile:

I think you need a binary sensor. You can create another helper, a template binary sensor, that mirrors the value of the first helper, then use this template binary sensor in the blueprint.

Or alternatively, you can skip the automation and just use the template binary sensor, writing the 3 minutes rule in the template. Ask ChatGPT or Gemini for help on how to write the template, theyā€™re great with this kind of requests.

I went ahead and asked myself. This should work, just change ā€œmotion_sensorā€ to the id of your motion sensor.

{{ (states.sensor.motion_sensor.state == 'on') and 
           (as_timestamp(now()) - as_timestamp(states.sensor.motion_sensor.last_changed)) > 180 }}
1 Like

Thank you - itĀ“s working!

1 Like

hi @Blacky ,
huge fan of your bluebrint, just saying cause I usually come here with errors.

One of my blue prints topped working. I get an error at the step where there is a first " choose"

Error: UndefinedError: ā€˜homeassistant.util.read_only_dict.ReadOnlyDict objectā€™ has no attribute ā€˜brightnessā€™

What could this be?

edit: I found it but canā€™t solve it. IN teh automation config screen (traces) it still shows an old switch as an entity. Is there a way to remove this?

edit 2: This didnā€™t seem to be the problem,
I remade the automation by coping the correct automation config.
I gives an error:

Stopped because an error was encountered at January 6, 2025 at 3:35:34 PM (runtime: 104.91 seconds)

@Icecoke7

You will have to create a template binary sensor and add it to your config file. I have a FAQ for this click here for more information but your code is below.

It is similar to REF - TS-2

Once you create it add it into the trigger.

template:
  - binary_sensor:
      - name: 'Dinner Table Delay Motion'
        device_class: motion
        icon: mdi:motion-sensor
        state: >
          {{ is_state('binary_sensor.your_motion_sensor_entity_id_here','on')}}
        delay_on:
          minutes: 3

Blacky :smiley:

1 Like

@Strux

  1. Your entity must have an ON / OFF state. Normally buttons can have no state or a quick ON / OFF. You will have to try and make the button toggle a toggle helper. You could try this blueprint and see if it works then use the toggle helper in the bypass. :nazar_amulet: Press Button - Turn ON & OFF Entities
  2. This is the perfect use case for a scene. Create a scene with your ceiling and mirror lights and adjust the brightness on each entity to your liking. You will then need to create a toggle helper and another scene with everything OFF. Look in the Lights section on were to put everything so it works well.
  3. Have a read of the FAQ on bypasses. It explains everything, click here

Blacky :smiley:

@victoroos

Maybe just start with a fresh automation and enter in all your entities and adjust your settings rather than copy paste.

Blacky :smiley:

Hello @Blacky

I wish you an happy new year.

Iā€™ve tried many different options, but Iā€™m sorry I canā€™t figured out how to prevent the automation to turn off the lights (never), if they were already on. I tried using ā€œbypass optionsā€ with an helper activated when the scene is activated, but never found the right configuration.

I have a couple of lights and a motion sensor.

What I want is :

  • Let the user control the lights using a scene
  • Between 10am and 20pm, if occupation turns on, and the luminosity is under X lux, turn on the lights during Y min)
  • If the lights are off, turn on the lights, if the lights are already on : do nothing !

Any help will be appreciated !

@Hugoliv

Could you please provide us your YAML of the automationā€¦ the best one you have configured? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on ā€œ</>ā€ and paste code in there.

Blacky :smiley:

@Blacky

Thanks and this worked as you suggested.

Sorry for all the questions, but I might have one more ask.

So I created the group sensor Other Zone, Desk Zone and Rack Zone.

I have the Other Zone as Cool White and the Desk Zone like you suggested as the night lights with warm white. If I wanted the Rack Zone a different color of lights how would I implement that? I am pretty sure I am getting a little more complex and probably would need a script or something

Thanks for you help