arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
462 stars 104 forks source link

MQTT server not running #350

Closed simplenotezy closed 3 years ago

simplenotezy commented 3 years ago

I have tried following the installation guides and configured through the Config UI.

My config file looks like this:

{
    "bridge": {
        "name": "Homebridge EF60",
        "username": "XXX",
        "port": XXX,
        "pin": "XXX"
    },
    "accessories": [
        {
            "type": "thermostat",
            "name": "ECO1",
            "logMqtt": true,
            "topics": {
                "getName": "ECO1"
            },
            "accessory": "mqttthing"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Hue",
            "users": {
                "XX": "XXX"
            },
            "anyOn": true,
            "forceHttp": true,
            "groups": true,
            "group0": true,
            "hosts": [
                "192.168.39.108:80"
            ],
            "lights": true,
            "linkButton": true,
            "nativeHomeKitLights": true,
            "nativeHomeKitSensors": true,
            "nupnp": true,
            "resource": true,
            "rooms": true,
            "rules": true,
            "scenes": true,
            "scenesAsSwitch": true,
            "schedules": true,
            "wallSwitch": true,
            "platform": "Hue"
        },
        {
            "auth": {
                "clientId": "XXXX",
                "clientSecret": "XXXX"
            },
            "common": {
                "homekitUser": "XXXX"
            },
            "video": {},
            "platform": "NelloPlatform"
        }
    ]
}

I notice theres no "platform" registered for mqtthing, is that on purpose?

Also, I think it might be due to my lack of experience with this, but I think it's pretty difficult getting started. All I want, as a start, is to see if I can control my Danfoss Eco 2 Thermostats via my Homebridge.

I use https://github.com/OpenZWave/Zwave2Mqtt to try to register the ZWave devices, and then the plan is to send this data to MQTThing server - not sure if this is the right approach though.

Zwave2Mqtt is complaining:

  z2m:Mqtt MQTT client reconnecting +3s
  z2m:Mqtt connect ECONNREFUSED 192.168.39.180:1883 +4ms
  z2m:Mqtt MQTT client closed +2ms

Any ideas?

arachnetech commented 3 years ago

homebridge-mqttthing doesn't run its own MQTT server - it expects you to run one externally. Are you running MQTT on your Homebridge server? If not, you'll need to configure it in the mqttthing accessory.

There is no platform configuration. Homebridge plugins can only support configuration as a platform or as accessories, not both.

simplenotezy commented 3 years ago

I see. Thanks for your very prompt reply. I was suspecting this, but since the Installation guide did not mention any prerequisites I guessed it would work "out of the box". Any recommendations for installing MQTT server on my PI/Homebridge?

simplenotezy commented 3 years ago

Oups; closed by mistake, anyhow, I will accept any suggestions with much grattiude.

arachnetech commented 3 years ago

Good call re. pre-requisites. I should update that.

I'm using Mosquitto myself.

sudo apt-get install mosquitto
sudo apt-get install mosquitto-clients
simplenotezy commented 3 years ago

Thanks for that @arachnetech! Actually I just found a guide online which I am following now to set things up: https://appcodelabs.com/introduction-to-iot-build-an-mqtt-server-using-raspberry-pi and it also recommends mosquitto ;)

Next big question is: How do I detect Z-Wave devices and have them send data to MQTT. I have found ZWave2Mqtt, but currently struggling even discovering my Thermostat: https://github.com/OpenZWave/Zwave2Mqtt/issues/802

Perhaps you know another way to detect my Thermostat?

arachnetech commented 3 years ago

That sounds like a z-wave issue, and unfortunately I don't use that myself that I can't really help.

There are some tested configurations in the Wiki at https://github.com/arachnetech/homebridge-mqttthing/wiki/Tested-Configurations which may help you.