Hi,
I am new to HA and MQTT so will be happy to get some help.
I created mqtt switch. All configurations below.
I am trying to check it as in an example on " MQTT Switch" page
When I am sending message as folowing
Switch stays in off state and status is “Unavailable”
I enabled MQTT logging and in log I see:
2019-03-12 23:11:41 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/#
2019-03-12 23:11:41 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to homeassistant/#
2019-03-12 23:11:41 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hass/status: online
2019-03-12 23:11:41 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to home/bedroom/switch1/available
2019-03-12 23:11:41 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to home/bedroom/switch1
2019-03-12 23:11:42 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on home/bedroom/switch1/available: b'ON'
2019-03-12 23:11:42 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on home/bedroom/switch1: b'ON'
So it seems HA gets the message, but switch still in OFF state.
What I am doing wrong?
I have Intel NUC7i5BNK with Ubuntu 18.04 LTS hass.io with HA 0.89.1 installed in docker
I installed Mosquitto broker add-on
Configurations as following:
The ip address you are using is for the localhost, which may not be correct depending on your docker settings and where you run the command from. Try using the address for the broker you have in the ha configuration file.
Edit:
And a second thing, you may have to send the availablitly topic first, to indicate to HA that the device is available before it will acknowledge the state change. Or just remove the availability line from your config.
You need to add the payload with the -m parameter. The value of this is defined by the payload_available setting in your HA configuration. Since you haven’t defined that, it is the default of online. So try
I am new to miqtt but use HA on an intel NUC using docker. How do I install the miqtt broker in this setup? Do I need to fire up a seperate docker container with the broker in it?