Warning after reboot. TypeError: argument of type 'NoneType' is not iterable

Ok? :thinking: If you like, feel free to tell us more. And please keep me updated when you have created an update.

Sure, I will keep you updatedšŸ‘

Below is my issue. First, the syntax in Ā« value_template Ā» is not correct at all but as it was working, I did not check carefully.


actions:
  - variables:
      command: '{{ trigger.payload }}'
  - choose:
      - conditions: '{{ "press_" | string in command }}'
        sequence:
          - wait_for_trigger:
              - trigger: mqtt
                topic: '{{ base_topic ~ "/" ~ controller ~ "/action" }}'
                value_template: 'release_'

I could suppress Ā« value_template Ā» and it would still work as after a ā€˜press_1ā€™ we should always received a ā€˜release_1ā€™. The same for the 4 buttons applyā€¦

What I would like to achieve and for my learning as well is this. As soon as the payload is ā€˜release_ā€™ what ever is written after this, the trigger is valid.
I guess, I need to filter the payload or an equivalent but I have for the moment no idea how to write it.

Maybe, I could write a list.

payload:
  - release_1
  - release_2
  - release_3
  - release_4
  - release_1_and_3
  - release_2_and_4

The goal is to have minimum line and code for maximum efficiency

Thanks

Me absolutely neither. Looks like a tough nut to crack. Iā€™m keeping my fingers crossed that you find a solution!

Edit:

Maybe Iā€™m thinking too simply, but couldnā€™t it be similar to the conditions line?

'{{ "release_" | string in command }}'

This condition is a boolean. It is either false or true.

I have read carfully the mqtt trigger and I have maybe an idea how to achieve this. I can not try it yet as I do not have a physical access to my PTM until the end of the weekā€¦

Okay I understand. I already wrote that I probably thought too simply. Sorry :sweat_smile:

Please donā€™t stress about me. Iā€™m already satisfied that your previous blueprint is running fine and no longer produces warning messages.

I am also pleased that you would like to deal with the new event trigger even when the time has come in z2m. I would probably be hopelessly lost on my own.

I use a bunch of PTM215/ZE and 216Z. I need them working correctly. The annoucement made on Z2M forced me to have a look at the blueprints I created for myselfā€¦ It still remains a minor correction to apply to this one and it is good for my knowledge as well.

For the event trigger, it is a kind of must to understand it otherwise I will be stuck in old version of Z2Mā€¦

I would like to finish this small project, like that, I may focus on other thingsšŸ˜‰. I am glad to see my work is helping a bit

There is an update available here (Version 2024.10.31). The last issue I had is now solved and everything is working as expected

As stated in a previous reply, a careful read of the mqtt trigger help solved the issue I was facing

      - conditions: '{{ "press_" | string in command }}'
        sequence:
          - wait_for_trigger:
              - trigger: mqtt
                topic: '{{ base_topic ~ "/" ~ controller ~ "/action" }}'
                payload: "release"
                value_template: '{{ value.split("_")[0] }}'

Enjoy and feel free to tell me if any errors are found

Thank you very much. But I need a few days, because I donā€™t have physical access to my PTM 215Z at the moment, too.

Iā€™ll give you feedback.

Hey @chris-1243 , I tested your new version 2024-10-31. Unfortunately, it doesnā€™t work for me. Simple press commands to turn on donā€™t work. In the trace I could see that the hold command is being tried (brightness move for me).

Iā€™m back to your version 2024-10-27. It still works.

Could use this link and try if the version 2024.11.04 is working ?

I found my mistake. Copy/paste human errorā€¦

Yep. This looks good and version 2024-11-04 works. Thank you very much! :+1:t2:

Great news!!! Thanks for your time

The thanks are due to you! After all, you are helping me too.

One more question, itā€™s not entirely clear to me. Would this blueprint also work with zigbee2mqtt 2.0? MQTT trigger can still be used and is not discontinued. Or is the affected action property still being used?

According to my reading and understanding, this blueprint should work with Z2M 2.0.

The recommanded way with Z2M 2.0 would be to use the event trigger as it seems easier than mqtt trigger.

Wait and see. It should have part of this new option in the next release.

Thanks for the clarification. That takes some of the pressure off.

It remains exciting. Letā€™s hope that the event trigger really does make things easier.