Tasmota MQTT Domoticz

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
FredZ
Posts: 30
Joined: Monday 08 June 2020 6:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Tasmota MQTT Domoticz

Post by FredZ »

Hello all

Been struggling with this for four days and can't seem to see the wood for the trees.

Scenario:
Domoticz
Version: 2020.2
Build Hash: b63341bc0
Compile Date: 2020-04-26 23:47:55
dzVents Version: 3.0.2
Python Version: 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0]

It is install on a debian buster VM

Sonoff 4CH_PRO_R3
Flashed with Tasmota 9.1.0

MQTT
have installed mosquitto server/client on the buster server. Only a default install. No alterations.

In the dom log I see the line

Code: Select all

2021-03-15 19:52:20.236 (Tasmota MQTT) MqttClient::onConnect: MQTT Server: localhost:1883 as Domoticz_1615788868_6218
In the Sonof consol I get

Code: Select all

07:56:54 WIF: Checking connection...
07:56:56 MQT: Attempting connection...
07:56:56 MQT: Connect failed to 192.168.1.25:1883, rc -2. Retry in 10 sec
192.168.1.25 is the ip of the dom vm where mosquitto is installed.

The Sonoff/Tasmota has defaults for MQTT with the host set to 192.168.1.25

I'm obviously missing something as i'm going round and round in circles getting knowwhere.

If someone would be so kind as to point me in the direction of a howto/information I would be most appreciative as I'm about to file yet another device in the draw as unusable. I have a large collection already.

Your comments would be most helpful.

Regards

Fred
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Tasmota MQTT Domoticz

Post by eddieb »

make sure mosquitto is running and listening
root@domoticz:~# netstat -atnp | grep LISTEN | grep mos
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 588/mosquitto
tcp6 0 0 :::1883 :::* LISTEN 588/mosquitto
the message in your tasmota devices says it cant connect to your mosquitto server, double check if that port 1883 is reachable ...
Last edited by eddieb on Monday 15 March 2021 9:43, edited 1 time in total.
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Tasmota MQTT Domoticz

Post by waaren »

FredZ wrote: Monday 15 March 2021 8:34 If someone would be so kind as to point me in the direction of a howto/information I would be most appreciative as I'm about to file yet another device in the draw as unusable. I have a large collection already.
To confirm both the MQTT service and domoticz MQTT config are OK:

Open a CLI session on your domoticz server and issue below command

Code: Select all

sudo mosquitto_pub -h 192.168.1.25 -m '{"command" : "addlogmessage", "message" : "MyMessage to log" }' -t domoticz/in
You should see in the domoticz log that it received and processed the command.

btw. If the mosquitto_pub command is not recognized you should install the mosquitto clients first; using:

Code: Select all

sudo apt install mosquitto-clients
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
djreesing
Posts: 16
Joined: Friday 16 December 2016 15:25
Target OS: Raspberry Pi / ODroid
Domoticz version: stable
Contact:

Re: Tasmota MQTT Domoticz

Post by djreesing »

I had a similar problem after updating mosquitto. Seems to from version 2.0.0 onward the default config will only bind to localhost and refuses connections from other machines than mosquitto is running on.

To fix this edit the /etc/mosquitto/mosquitto.conf file and add:
listener 1883
allow_anonymous true

Note that his will give access to the mqtt broker for all devices on your network
User avatar
waltervl
Posts: 5846
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Tasmota MQTT Domoticz

Post by waltervl »

djreesing wrote: Monday 15 March 2021 15:40 I had a similar problem after updating mosquitto. Seems to from version 2.0.0 onward the default config will only bind to localhost and refuses connections from other machines than mosquitto is running on.
See also viewtopic.php?f=28&t=35706 and https://www.domoticz.com/wiki/MQTT#Installing_Mosquitto
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest