Hi,
I have an issue where the same event is being sent to home assistant several times.
The MQTT topic is retained by design, and the json within the topic is static
{
"event": "button pressed",
"inputId": "48402;3"
}
So it’s not a on or off message, but rather just a push of a button.
This is my trigger (Created with GUI editor)
alias: boolean Bedroom
description: ''
trigger:
- platform: mqtt
topic: homeassistant/device_automation/48402_3/event
condition: []
action:
- service: automation.turn_off
target:
entity_id: automation.bedroom
data:
stop_actions: false
- service: input_boolean.toggle
target:
entity_id: input_boolean.bedroom
- delay:
hours: 0
minutes: 0
seconds: 4
milliseconds: 0
- service: automation.turn_on
target:
entity_id: automation.bedroom
mode: single
The thing is when used, the lights just turn on and off,
so I setup an MQTT server with full debug logs, and it seems when I receive a button press from the component, I receive hundreds of published to Home Assistant.
Anyone got an idea?
I have reached out to the support, and requested them to remove the retain flag, as that doesn’t seem to make sense, but I am not sure why that would cause MQTT server to resend the same message hundred of times?
(well, at least it only sent once to mqtt-explorer )
edit
After posting this, did the component even sent retain flag as on? (r0)
but suddenly after a while, retain flag is set?
7daebb60676c4882b584bfac16e7b131 = is the component
2UokJOjH1QOM1JMskPQOio = is home assistant
2021-09-28T20:32:43: Received PUBLISH from 7daebb60676c4882b584bfac16e7b131 (d0, q1, r0, m31475, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:43: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r0, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:43: Sending PUBLISH to mqtt-explorer-3c0db0a3 (d0, q0, r0, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:44: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:44: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:45: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:46: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:47: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:47: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:47: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:48: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:48: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:48: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:49: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:49: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:50: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:50: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
edit 2
a more detailed mqtt log
2021-09-28T20:32:43: Received PUBLISH from 7daebb60676c4882b584bfac16e7b131 (d0, q1, r0, m31475, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:43: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r0, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:43: Sending PUBLISH to mqtt-explorer-3c0db0a3 (d0, q0, r0, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:43: Sending PUBACK to 7daebb60676c4882b584bfac16e7b131 (m31475, rc0)
2021-09-28T20:32:44: Received SUBSCRIBE from 2UokJOjH1QOM1JMskPQOio
2021-09-28T20:32:44: homeassistant/device_automation/48402_3/event (QoS 0)
2021-09-28T20:32:44: 2UokJOjH1QOM1JMskPQOio 0 homeassistant/device_automation/48402_3/event
2021-09-28T20:32:44: Sending SUBACK to 2UokJOjH1QOM1JMskPQOio
2021-09-28T20:32:44: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))
2021-09-28T20:32:44: Received SUBSCRIBE from 2UokJOjH1QOM1JMskPQOio
2021-09-28T20:32:44: homeassistant/device_automation/36952_3/event (QoS 0)
2021-09-28T20:32:44: 2UokJOjH1QOM1JMskPQOio 0 homeassistant/device_automation/36952_3/event
2021-09-28T20:32:44: Sending SUBACK to 2UokJOjH1QOM1JMskPQOio
2021-09-28T20:32:44: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/36952_3/event', ... (46 bytes))
2021-09-28T20:32:44: Received SUBSCRIBE from 2UokJOjH1QOM1JMskPQOio
2021-09-28T20:32:44: homeassistant/device_automation/48402_3/event (QoS 0)
2021-09-28T20:32:44: 2UokJOjH1QOM1JMskPQOio 0 homeassistant/device_automation/48402_3/event
2021-09-28T20:32:44: Sending SUBACK to 2UokJOjH1QOM1JMskPQOio
2021-09-28T20:32:44: Sending PUBLISH to 2UokJOjH1QOM1JMskPQOio (d0, q0, r1, m0, 'homeassistant/device_automation/48402_3/event', ... (46 bytes))