I currently have the following automation in order to switch on and off a double_garage light in Home Assistant when an on/off message is received via MQTT hub.
however the mqtt light only sends correct ON and OFF messages to the topic “light/double_garage” but when I do send an ON or OFF message myself through either mosquitto_publish or the HA console the light does not respond.
yes… sent the same message and subscribing from another host and listening to #topic shows the same identical messages as received by the MQTT hub.
Yet lights only respond when clicked not through MQTT messages.
mosquitto_sub -v -P Dxxxxxx -t # -p 1883
Warning: Not using password since username not set.
light/double_garage OFF
light/double_garage ON
nope, tried uppercase, lowercase, 0, 1 nothing.
Beyond that, if I could parametrize the automation it would not be a problem for me, but currently it is too verbose to specify two rules for each switch! any idea?
Yeah good point, I left the parameter there to remember in the future to enable authentication but since I specify no username apparently the option is ignored. from the manual:
Provide a password to be used for authenticating with the broker. Using this argument without also specifying a username is invalid. This requires a broker that supports MQTT v3.1. See also the --username option.
probably I’ll be better to remove it even though I think it isn’t causing any issues at the moment.