When I run the script I get the following error in HA: BrokerProtocolHandler Unhandled exception in reader coro: IncompleteReadError('0 bytes read on a total of 1 expected bytes',)
I can’t really see what I’m doing wrong here, any suggestions?
Both the brokers use the same MQTT protocol, so it is perfectly possible to use mosquitto_pub with the embedded broker.
If you are using mosquitto, the configuration for that is done in the mosquitto configuration files, not in HA configuration files. To use mosquitto, the HA configuration should be
mqtt:
broker: <ip address of your broker machine>
If you are running mosquitto on the same machine as HA, you can refer to localhost rather than specifying an address.
Sorry, I forgot you have to use the parameters -V mqttv311 to get mosquitto_pub to work with the HA embedded broker, but it does work fine.
However, this is not relevant to your problem, because you are using mosquitto. Have you tried removing all the unnecessary embedded configuration to see if that helps?