Core: mqtt payload trigger not triggering (zigbee2mqtt)

Created on 23 Jan 2019  路  2Comments  路  Source: home-assistant/core

Home Assistant release with the issue:
None

Last working Home Assistant release (if known):
None

Operating environment (Hass.io/Docker/Windows/etc.):
Hassbian

Component/platform:
MQTT-Component / mqtt
Zigbee2mqtt

Description of problem:
To describe whats not working i would like to show first whats working:

This Automation works:

- action:
  - data:
      entity_id:  cover.peq0005525
    service: cover.close_cover
  alias: Schlafzimmer - Rollladen - Click - Runter
  id: '1516357577437'
  condition:
    condition: template
    value_template: '{{ "single" == trigger.payload_json.click }}'
  trigger:
    platform: mqtt
    topic: 'zigbee2mqtt/0x00158d00012433dc'

Zigbee2mqtt console is giving me:

Jan 23 21:29:30 hassbian npm[506]: zigbee2mqtt:info 1/23/2019, 9:29:30 PM MQTT publish: topic 'zigbee2mqtt/0x00158d00012433dc', payload '{"battery":77,"voltage":3002,"linkquality":107,"click":"single"}'

Now Whats not working:

- alias: Bewegungsmelder Flur Nachricht Telegram
  trigger:
    platform: mqtt
    topic: 'zigbee2mqtt/0x00158d0001e0a712'
  condition:
    condition: template
    value_template: '{{ "true" == trigger.payload_json.occupancy}}'
  id: '1519914515852'
  action:
  - data:
      message: "Bewegung im Flur erkannt"
    service: notify.telegrambot

Zigbee2mqtt console is giving me:

Jan 23 21:31:50 hassbian npm[506]: zigbee2mqtt:info 1/23/2019, 9:31:50 PM MQTT publish: topic 'zigbee2mqtt/0x00158d0001e0a712', payload '{"illuminance":0,"linkquality":0,"occupancy":true,"battery":100,"voltage":3045}'

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


Traceback (if applicable):

Here are two guys with the exact same issue:

https://community.home-assistant.io/t/zigbee2mqtt-getting-rid-of-your-proprietary-zigbee-bridges-xiaomi-hue-tradfri/52108/512

https://community.home-assistant.io/t/zigbee2mqtt-getting-rid-of-your-proprietary-zigbee-bridges-xiaomi-hue-tradfri/52108/790

Additional information:
I created a mqtt-sensor to check if it gets the "True" or "False" from payload:

sensor:
- platform: mqtt
  name: "Payload Bewegungsmelder"
  state_topic: "zigbee2mqtt/0x00158d0001e0a712"
  value_template: "{{ value_json.occupancy }}"

The sensor is working and shows True and False.

Most helpful comment

Yeah I had the same problem. But just removing the "" around the true and false did it.
'{{ trigger.payload_json.occupancy == true }}'

All 2 comments

Yeah I had the same problem. But just removing the "" around the true and false did it.
'{{ trigger.payload_json.occupancy == true }}'

Problem solved. Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YellowMonster76 picture YellowMonster76  路  3Comments

kirichkov picture kirichkov  路  3Comments

moskovskiy82 picture moskovskiy82  路  3Comments

Konstigt picture Konstigt  路  3Comments

sogeniusio picture sogeniusio  路  3Comments