Skip to content

Bug: MQTT Topic Issue #97

@TotallyInformation

Description

@TotallyInformation

Hi, again many thanks for all your time and effort on this code, it is very much appreciated.

I needed to move all of the cmnd, stat and tele topics in order to fit in with my existing Node-RED based home automation project.

So I made some adjustments in user_config.h as follows:

#define SUB_PREFIX             "COMMAND/sonoff"       // Sonoff devices subscribe to:- cmnd/MQTT_TOPIC and cmnd/MQTT_GRPTOPIC
#define PUB_PREFIX             "DEVICES/sonoff"       // Sonoff devices publish to:- stat/MQTT_TOPIC
#define PUB_PREFIX2            "DEVICES/sonoff"       // Sonoff devices publish telemetry data to:- tele/MQTT_TOPIC/UPTIME, POWER/LIGHT and TIME
                                            // May be named the same as PUB_PREFIX
#define MQTT_TOPIC             MQTT_CLIENT_ID  //PROJECT

So I expected to get output on the topics:

DEVICES/sonoff/sonoff-5138/#

But this isn't the case. Instead I am getting output on:

DEVICES/sonoff/sonoff/#

Same problem with issuing commands COMMAND/sonoff/sonoff/status is accepted but COMMAND/sonoff/sonoff-5138/status is not. However COMMAND/sonoff/DVES_073412/status is accepted (which is defined by DEF_MQTT_CLIENT_ID in the main code.

So am I right in thinking that there is a code issue somewhere or have I misunderstood the settings? I have several Sonoff's that I want to set up so I need the MQTT topics to be unique & I would prefer that do come from the code so that I don't have to remember to reset them by hand after updates.

Regards, Julian.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions