Hi,
I’ve been using home assistant for a couple of months, but it is the first time I’m trying to integrate a device using MQTT. In short I am unable to read out the devices in home assistant, even though I can successfully read the message sent from the devices using an external client (MQTTLens)
The broker I am using is mosquitto through the home assistant addon. I have followed the steps detailed in the documentation to setup ACL and am using anonymous mode.
The devices are a series of coils from a modbus PLC. Through Modbridge I can read these inputs and push any updates of those through MQTT.
As I wrote above, when I use MQTT lens, pointing to the broker in home assistant, I receive all messages correctly. (note: when I input credentials of the user I created in HA instead of leaving it blank, I don’t receive the messages, I don’t know why, but I thought it is worth mentioning. Maybe that’s the issue, but how can I solve this?)
As you can see, the topic the device sends is the input number (here Coil31) with a payload ‘trigger’.
Here come the issues:
- I have tried defining a sensor in my configuration file, but I seems like it doesn’t receive any data, it stays blank.
sensor:
- platform: mqtt
name: "MQTTtest"
state_topic: "Coil31"
- When I use mqtt.publish through the developer tools, I don’t see the message in MQTT lens, but I can see the message in HA.
Any help would be greatly appreciated.
Many thanks,
Tom