2024.2: More voice, more icons, more integrations, more... everything!

How are you triggering?

Manually triggering works, thatā€™s what Iā€™m using to test.

I noticed something I thought was weird, and I donā€™t know if it is important.
entity_id": "script.inovelli_mass_configurator_duplicate",

my query was, why the reference to ā€œduplicateā€?

Anyway, my bedtime now, maybe someone else will spot something while I sleep. Wish I could be more help.

I duplicated the script so I could mess with it during testing. The one I posted here was the original script. The duplicate is the same as the original as well.

Just a wild guess - is this indicating that your device variable is producing an empty list? Might want to check that part of the script

Why would this suddenly result in an empty list? It didnā€™t before.

Also this code syntax is proper. Any ideas?

The name of your dimmers probably changed in z2m. Adjust the code to look for the new names

I checked that too, it matches.

Thatā€™s the only limiting factor in the code.

I know. Itā€™s almost as if the code is failing to run at all. But there are no errors in any logs.

Probably because the message is successfully published to MQTT. Thereā€™s just nothing happening after that, I suppose. The trace shows your script ran successfully. Youā€™ll need to check the MQTT topics/config (I donā€™t know z2m). I think youā€™ll find that if you manually publish your MQTT message via the dev tools that nothing will happen. Take it from there.

Did you try to test your template which creates the devices variable in devtools > templates?
In the trace it shows that it returned an empty list. Which would indeed result in your script doing nothing (the input for your first for_each repeat is an empty list)

When pasting the whole script in Developer tools > template, I get:

 ā€˜repeatā€™ is undefined.

Doesnā€™t make much sense, it is absolutely defined.

No thatā€™s not the template I meant.
This template seems to be returning an empty list

        {%- set device = iif(device is string, [device], device) -%}
        {%- if (device | length > 0) -%}
          {{ device }}
        {%- else -%}
          {%- set ns = namespace(devices=[]) -%}
          {%- for device_id in integration_entities('mqtt') | map('device_id') | unique -%}
            {%- if (device_attr(device_id, 'model') == 'Inovelli 2-in-1 switch + dimmer (VZM31-SN)') -%}
              {%- set ns.devices = ns.devices + [device_id] -%}
            {%- endif -%}
          {%- endfor -%}
          {{ ns.devices }}
        {%- endif -%}

That just shows

[]

And Iā€™ve changed the name to match model in Z2M in every way imaginable, it still shows

[]

What could this be? The code again seems to not be running at all.

Itā€™s the device model, not the name

Yes, the device model matches whatā€™s in Z2M.

Description: 2-in-1 switch + dimmer

Zigbee Model: VZM31-SN

Model: VZM31-SN

So thatā€™s your issue, you are not providing any device for the repeat action

Your code is looking for this model.

I know, Iā€™ve changed it to just VZM31-SN

Itā€™s still showing

[]