#Blueprint not triggering Z2M

1 messages ยท Page 1 of 1 (latest)

strong patrol
#

I don't have any experience with that blueprint, but first things first. Are you sure it's not triggering?

#

(I moved to a thread to keep the complaints down...)

#

If you are sure it's not triggering, look in the logs to see if it is kicking up errors.

thorny elk
#

Thanks for your help. Yeah, in my automations list, the one in question says "Never" under last triggered

#

Nothing in logs that I can see.

#

I can make an automation (without the blueprint) that succesfully triggers when a button is pressed like this:

#

`platform: state
entity_id:

  • sensor.switch_cinema8way_action
    to: on_1`
#

But I would really like to make the blueprint work as otherwise I end up making tons and tons of individual automations for each button

strong patrol
#

So looking at it, it's triggering off of the MQTT directly. Do you have mqtt-explorer installed?

thorny elk
#

that's new to me, I don't think so

strong patrol
#

See the blueprintis pulling mqtt data, that state of the switch you quote there is the HA state, they may not exactly match

thorny elk
#

Ah okay. Hang on will set up the explorer

strong patrol
thorny elk
#

ah actually I can see this in my zigbee2mqtt log

strong patrol
#

it's a bit busy there, but yes, probably

thorny elk
#

2023-01-23 19:58:41 MQTT publish: topic 'zigbee2mqtt/Switch-Cinema 8Way', payload '{"action":"', "battery": 200, "linkquality": 102}' 2023-01-23 19:58:41 MOTT publish: topic 'zigbee2matt/Switch- Cinema gWay/action', payload 'on_1'

#

that's copied a bit weird one sec

#

MQTT publish: topic 'zigbee2mqtt/Switch-Cinema 8Way/action', payload 'on_1'

strong patrol
#

probably just the 2nt one your your case

thorny elk
#

Ah actually there aren't any space in there, it's just for some reason I can't copy text off the zigbee2mqtt log so I used a screenshot>OCR tool which didn't do a great job. the topic is definitely zigbee2mqtt/Switch-Cinema8Way/action in the logs, no spaces

#

but maybe it's the hyphen?

strong patrol
#

maybe

thorny elk
#

will try - thanks again for your time on this

#

No joy ๐Ÿ˜ฆ

strong patrol
#

I stand correted. That is looking at the HA sensor, not the MQTT side.

#

That restart mode seems strange to me actually. may not be the problem but Z2M pops out a null trigger before and after actual actions, ai I always run these in single mode.


mode: single
#

Net thing to look at is the sensor in developer mode - state to see what HA is seeing.

thorny elk
#

OK, I tried changing the mode to single in the blueprint yaml, and reloaded automations. That seemed to make no difference.

strong patrol
#

If that does fix the problem, I suggest doing an issue on that GIT to have them change it....

thorny elk
#

Ah so in the developer mode, it seems like pressing a button never shows a change in the state of the sensor. Looking at the logbook, it DOES change the state momentarily when I press a button, but then it seems to set the state back to nothing when I release the button

strong patrol
#

That's how Z2M works.
If set for a few minutes, it's asleep
trigger a button- wake trigger happens
null trigger is sent to clear that
button action is sent
null trigger action is sent to clear that

thorny elk
#

Understood. And the !input here means it should trigger when there's any input at all?
`trigger:

  • platform: state
    entity_id: !input "remote"
    attribute: action`
strong patrol
#

So this blueprint doesn't screen out all those unwanted triggers, and therefore if/when it does work, it will be spamming the log with junk.

strong patrol
#

In this case you were / are not getting triggers at all,

#

should be getting more that you want. Points to it's not the right sensor or something.

#

Or a fundamental problem with the blueprint.

thorny elk
#

Hmm. So weird. The blueprint code seems so straightforward

#

And this trigger.to_state from the blueprint seems correct?
`action:

  • variables:
    command: "{{ trigger.to_state.state }}"
  • choose:
    • conditions:
      • "{{ command == 'on_1' }}"
        sequence: !input "on_button_1_short"`
strong patrol
#

That trigger should work I think. I have a blueprint that does it a bit different, but the say-ish...

trigger:
- platform: state
  entity_id: !input 'remote'
action:
- variables:
    event: '{{ trigger.to_state.attributes.action }}'
    entity_id: !input 'remote'
    friendly_name: '{{ trigger.to_state.attributes.friendly_name }}'

#

I just trigger on any state change and pull out the action attribute. They trigger on a state change of the action attribute and use it that way.

thorny elk
#

One thing I notice, is that in the trigger bit of the blueprint, it is looking for an 'attribute' of 'action':
`trigger:

  • platform: state
    entity_id: !input "remote"
    attribute: action`
#

but in the HA developer tools, it's not showing 'action' as an attribute, it's just that the sensor itself is called sensor.switchcinema8way_action

strong patrol
#

ok

thorny elk
#

so maybe I should try removing the attribute: action from the blueprint?

#

YES THAT FIXED IT

#

๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

strong patrol
#

You are in a different mode in Z2m... Thereare 2 modes, this style needs the legacy mode or you have to ajust things to get it to work in the other mode

thorny elk
#

is that the 'Legacy API' setting in Z2M?

thorny elk
#

it's off at the moment in my settings

strong patrol
#

That should work. make sure and test stuff out.

thorny elk
#

I haven't touched those so that must be the default. I'll try turning on the legacy entity attributes and see if anything else breaks ๐Ÿ™‚

#

Thanks so much for walking me through this logically, I really appreciate it

strong patrol
#

I hate it when people put Blueprints out with no documentation or knowledge of what they are doing. That person appears to be more interested in selling the devices that making a good blueprint to use them.

thorny elk
#

there definitely seems to be a lot of variability in the quality

#

I think a lot of the most popular ones, motion sensor based lighting triggers etc, should really just all be integrated into HA 'properly' at some point. I've tried a bunch of the top rated blueprints along those lines and they all miss one piece of the puzzle in some way

whole creek
strong patrol
#

no, the blueprint author...

whole creek
#

Ah, i see ๐Ÿ˜‚

strong patrol
#

That is you.

#

I see a store and a buy link on the page, but not a lot of help for people using the blueprint

whole creek
#

Haven't gotten around to it. Yet.
But what seemed to be the matter. Something about a legacy format?

thorny elk
#

I for one am relieved someone wrote a blueprint that got me 99.99% of the way there

#

It worked as soon as I removed the attribute: action from the trigger

strong patrol
#

I suggest you let them know it's set-up for non-legacy mode at least to prevent this fellow's problems

whole creek
#

Wasn't aware of such a mode. But will update the post.

strong patrol
#

Also I woud add a condition to prevent the log from getting spammed with the Z2M null and wake triggers.

#

Look above, I have links to my stuff to help you out.

thorny elk
#

Well thanks to you both I now have wife-friendly wall controllers that let her do the APPARENTLY NECESSARY 'being able to turn the lights in a room on and off without taking out my phone' ๐Ÿ™‚ So much appreciated

strong patrol
#

That legacy-non legacy is a pain. It constantly trips people up and it's hard ro recognize during support calls.

whole creek