MQTT delivered but respective automation not called?!?!

after two days of attempts, i’m crumbling into despair here; any thoughts/pointers/diagnostics would be appreciated.

After an update/upgrade to my pi (when all was working; foolish i know) my hue dimmer remotes aren’t launching there respective automations.

i’m using this - https://github.com/dale3h/hue-mqtt-bridge - and the commands are being seen by mosquitto in terminal; if i run mosquitto_sub -h localhost -p 1883 -u xxx -P xxx -v -t '#' i get on button press:
hue/hue_dimmer_switch_2/buttonevent 1002

i’ve also enabled mqtt in logging, and see that home assistant recieves the command:
2017-07-08 14:08:43 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hue/hue_dimmer_switch_2/buttonevent: 1002

from various threads and forums:
i’ved checked mosquitto (1.4.12) is up and running at start using the systemctl command
i’ve updated my rpi firmware
ive updated paho mqtt (from my venv) to 1.2.2.

I even created an mqtt switch with the remote press as the trigger, and it switches in the hass gui, so I can only assume it’s a problem with my automation - which hasn’t changed inbetween this working and not…

here’s the automation:

  - alias: hue_tap2_button_1
    trigger:
      - platform: mqtt
        topic: hue/hue_dimmer_switch_2/buttonevent
        payload: '1002'
    action:
      - service: light.toggle
        entity_id: light.bloom

“help me HASS community, you’re my only hope!”

Make sure and set a client_id in your mqtt configuration. There’s a bug right now that seems to break mqtt if there’s no explicit client_id set.

thanks @johnboiles

here’s my config:
mqtt:
broker: 127.0.0.1
port: 1883
client_id: home-assistant-1
username: xxx
password: xxx
protocol: 3.1.1

so it looks like that’s already done.

1 Like

Yep, looks like that’s already done. I’m out of ideas, but i’ve only been using HA for a little over a week. Maybe someone more experienced will have some ideas

Have you tried no quotes around the payload? If it is a number, may not like the quotes.

thanks @phileep - yes that was something i tried!
I fixed this by inserting initial_state: True in all of my automations using the dimmer remotes. I don’t know why it worked, but it did.
thanks for the help.

1 Like