AtomBaf / homebridge-mqtt-tasmota

Homebridge handler for tasmota/MQTT devices
MIT License
5 stars 5 forks source link

Config help #6

Closed boboxx closed 2 years ago

boboxx commented 2 years ago

I just installed MQTT Tasmota 0.4.6 on HB 1.4.0 (running on a Debian VM).

I created a test device called "test", set topic to "tasmota_%06X" as indicated on my switch (Treatlife SS02 running Tasmota 11.0). I lest the rest as default.

on my switch:

MQTT Host : 10.1.10.2 (HB server IP) Port : 1883 User: DVES_USER Client: DVESDCC183 Topic: tasmota%06X Group topic 1: cmnd/tasmotas/ Full Topic: cmnd/tasmota_DCC183/ Fallback Topics: cmnd/DVES_DCC183_fb/ No Retain: Disabled

But it dosnet look like it's able to connect, in my HB logs I see: Error event on MQTT connect ECONNREFUSED 127.0.0.1:1883"

What am I doing wrong?

AtomBaf commented 2 years ago

HI I can't see why you have this problem: could you give the exact part of the config file you have for this accessory?

boboxx commented 2 years ago

sure this is what I have, I just used to gui for the config: { "name": "test", "type": "switch", "url": "mqtt://localhost:1883", "topic": "tasmota_%06X", "debug": false, "index": 1, "accessory": "mqtt-tasmota" }

AtomBaf commented 2 years ago

yep the url is not right here, just put "url": "mqtt://10.1.10.2:1883" instead.

boboxx commented 2 years ago

now I get :)

[2022-03-15, 4:48:07 p.m.] [test] Error event on MQTT connect ECONNREFUSED 10.1.10.2:1883 [2022-03-15, 4:48:08 p.m.] [test] Error event on MQTT connect ECONNREFUSED 10.1.10.2:1883 [2022-03-15, 4:48:09 p.m.] [test] Error event on MQTT connect ECONNREFUSED 10.1.10.2:1883 [2022-03-15, 4:48:10 p.m.] [test] Error event on MQTT connect ECONNREFUSED 10.1.10.2:1883 [2022-03-15, 4:48:11 p.m.] [test] Error event on MQTT connect ECONNREFUSED 10.1.10.2:1883 [2022-03-15, 4:48:12 p.m.] [test] Error event on MQTT connect ECONNREFUSED 10.1.10.2:1883

    {
        "name": "test",
        "type": "switch",
        "url": "mqtt://10.1.10.2:1883",
        "topic": "tasmota_%06X",
        "debug": false,
        "index": 1,
        "accessory": "mqtt-tasmota"
    }
AtomBaf commented 2 years ago

Have you setup a MQTT server on this host? You should install something like https://mosquitto.org/

boboxx commented 2 years ago

No I have not, installing a MQTT server is not listed as a requirement... "This is an all-in-one homebridge plugin to control various tasmota devices via MQTT."

I didn't know I need to install another service :)

AtomBaf commented 2 years ago

The topic setting is also wrong: you should use the full topic which is generated from the string tasmota_%06X Got to your tasmota device url and clic on the information button: you should see the actual topic from there

AtomBaf commented 2 years ago

An MQTT broker is required as this plugin is dedicated to MQTT devices (tasmota for instance). Sorry but I didn't put this as a requirement, I though it was obvious given the project name :)

In my setup I use a raspberry pi, and it is really easy to start an mosquito instance like that:

apt install mosquitto
systemctl start mosquitto
systemctl enable mosquitto
boboxx commented 2 years ago

thanks I got it working not that I have thew MQTT services installed and configured lol