I have an MQTT script to basically power cycle a smart plug if an MQTT request is sent by Blue Iris.
The whole automation works with the script that I made in Home Assistant when I tested it. And when I do a test MQTT request on Blue Iris, MQTT explorer has a message in the topic section for homeassistant, as expected. But the problem is that even though it seems like home assistant received the MQTT packet, it doesn’t do anything.
MQTT Broker logs don’t say anything about a blocked connection to the BI host.
My only assumption could be that ‘platform: mqtt’ could be something different for MQTT Broker. But I really don’t know at this point. Logs are a ghost town in Home Assistant.
The topic you’re using is uncomfortably similar to the topic that Home Assistant uses for MQTT Discovery. I suggest you use a different topic to avoid any potential overlap with MQTT Discovery (i.e. a malformed discovery topic and and/or discovery payload will be rejected).
Here’s how to confirm Home Assistant received the payload.
Go to Settings > Devices and Services > Integrations
Click the MQTT integration (if it’s not present then there’s the source of the problem)
Click Configure
In Listen to a Topic, enter your topic in Topic to Subscribe to.
Click Start Listening
Use an MQTT client to publish a payload to the topic
The payload should appear in the window
Click Stop Listening
If it received it but it fails to trigger the automation then I suggest you change the topic so that it doesn’t look like a discovery topic. For example:
I’m not really sure what else to do if it’s not receiving anything. Can’t be a firewall rule, it’s disabled on the VM and host machine. I don’t think HA has a software firewall.
Well, I changed it to blueiris/camera_status_kasa_smart_wi_fi_plug_1/control
The automation still works when triggered manually. Still the same problem as before. It won’t accept MQTT requests.
Is this the first time you are trying to get Home Assistant to work with MQTT?
If it is then we need to confirm that you have configured the MQTT integration properly. The result of the experiment I had asked you to perform implies Home Assistant is not connected to the MQTT broker.