I home assistant 0.96.5 Log file I obtain Error: No matching payload found for entity
I tried to config a binary sensor for Aqara DJT11LM vibration sensor but the error persist.
My configuration is:
The error message is telling you that the payload received via the state_topic is not ON or OFF.
Error: No matching payload found for entity
Your task now is to discover what is being published to zigbee2mqtt/0x00158d0009c3c80e. I suggest you use an MQTT client, like MQTT Explorer, to subscribe to that topic and observe its payloads. It may simply be that they are in lower-case: on and off.
What are the possible states for action? Currently it indicates vibration but what other state can it report? If it reports just two states for action then we can configure it as a binary_sensor. otherwise, like Tom explained, it will have to be configured as a sensor.
There’s a typing error in your value_template. It should be value_json.action not value_jason.action.
Hello Taras, thank you very much for your help.
Yes, if you could help me for the message template, vibrate, tilt, fall in Italian, I would be very grateful
- alias: 'Example2'
trigger:
platform: state
entity_id: sensor.vibro
action:
service: notify.telegram
data_template:
message: >
{% set actions = {'vibration':'Vibrazione', 'tilt':'Inclinazione', 'fall':'Cadere'} %}
{{ actions[trigger.to_state.state] if trigger.to_state.state in actions.keys() else 'Incognito'}}
The template defined a dictionary, called actions, containing the sensor’s three states (vibration, tilt, and fall) and their respective Italian translations.
If the value of trigger.to_state.state is found in the dictionary’s keys then it will display the translated value.
If it is not found in the dictionary it displays Incognito.
Thank you very much.
Another question: do you know about hide functions like bed_activity for this sensor and how to create and activate sensor in home assistant?
Yes, this is a fantastic device that also handles other hidden functions that can be used in multiple applications.
I ask you because, with your last script (translated), when the action is tilted, it also generates another unknown event that is shown with the word “incognito”, as you expected. This only with a tilt event.
Hello Taras, about error Error while executing automation automation.rileva_vibration. Invalid data for call_service at pos 1: required key not provided @ data[‘message’] this is my automation
- alias: Rileva vibration
trigger:
platform: state
entity_id: sensor.vibro
action:
service: notify.telegram
data_template:
message: >
{% set actions = {'vibration':'Vibrazione', 'tilt':'Inclinazione', 'drop':'Caduta'} %}
{{ actions[trigger.to_state.state] if trigger.to_state.state in actions.keys() else trigger.to_state.state }}