Comments (10)
Well the fall back topic is equal to the MQTT Client as the client has to be unique for MQTT to work. Using this feature every sonoff can still be addressed even if you have (accidently) set two sonoffs to the same Topic.
I never thought of the fact where someone would use the same name for both fall back topic AND Topic. I do not recommend it as it makes unique identification difficult.
If you first set MQTTClient and then want to set Topic using the same name the software does not allow it and sets Topic to the default as in user_config.h. I do not check the other way round and that's probably how you did it.
A name with a dash as in sonoff-1234
as Topic is perfectly fine. Same for MQTTClient.
from tasmota.
Understood. That's more or less as I expected it. Thanks for explaining
In that case I would like to continue with the suggestion to default to a unique name for the Topic. Defaulting to "sonoff" doesn't make sense if you own more than one module - which is most likely for 99% of Sonoff users...
Additionally I did not understand your decision to work with two id schemes, the last six MAC digits and a four digit decimal I can not relate to. Might be beneficial to use the MAC scheme only, wdyt?
from tasmota.
Will look into topic uniqueness
from tasmota.
No need for topic uniqeueness as the fall-back topic is already unique.
The standard topic is set to sonoff
so that when one new sonoff is flashed the user can configure it right away accessing it by the topic cmnd/sonoff/..
. The first thing to do than is renaming it to a user known unique name.
The use of the four digits decimal is a consequence of keeping unique hostnames as short as 15 character to satisfy Windows WINS Netbios naming.
from tasmota.
configure it right away accessing it by the topic cmnd/sonoff/... The first thing to do than is renaming it to a user known unique name.
For that purpose one can subscribe on cmd/+
. That's how MQTT is designed... http://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices
How would one deal with multiple freshly flashed modules? They would all receive the same new settings. If a user does the configuration via http (as most probably do) the default topic doesn't matter, it's just a nuisance to change it... In both cases a unique topic to begin with would have been easier.
Don't get me wrong, you know that I'm a fond user of your firmware! The process is simply a bit unclear. I'm not sure how a less experienced user will deal with these things. Intuitive usability is sometimes hard to get right. If "The first thing to do than is renaming it to a user known unique name." is part of your intended process, would be good to at least document it somewhere.
from tasmota.
using cmnd/+ addresses all devices in your environment and not just a few sonoffs (I have many different models like tickers, lcds, lights all not using this software). This does NOT address a unique device. So a grouptopic to address same kind of firmware is just a need.
The user selectable unique topic is a pet name used for all outgoing communication and is therefore mandatory.
Dealing with multiple new installs is done using the fallback topic so no problem at all.
Finally this software is to be used by someone willing to invest some time in getting to know a little about MQTT. All other features are making it nice to have.
from tasmota.
I agree that we disagree π
However I think we both made our point and what you are saying is totally valid of course.
I've added a few details to the wiki: https://github.com/arendst/Sonoff-Tasmota/wiki/Initital-Configuration
from tasmota.
@arendst great to see you've added a lot of sensors content. I did create the following menu entry/article for that: https://github.com/arendst/Sonoff-Tasmota/wiki/Hardware-Modification
Just so you know. You might want to delete the menu entry, rename the Initital-Configuration article or move the content. As you prefer.
from tasmota.
I am reviving this just to say that +1 it would be great of the default MQTT topic unique like the MQTT_CLIENT_ID.
I am about to flash over 10 of these and I was hoping not to have to set them up at all afterwards. My plan was to plug them in one at a time and press the button on them to get the topic from mqtt-spy and then assign the discovered topic to a switch in openHAB.
I was hoping to do something like this but it doesn't get translated into a unique value and is instead taken literally:
#define MQTT_TOPIC "sonoff_%06X"
Is there a way to make that dynamic like the client id?
from tasmota.
Nevermind.. I see that this is supported in the development branch according to #2409
from tasmota.
Related Issues (20)
- Wrong energy measures using module BL0937
- user_config_override.h missing HOT 1
- Coosa Plug lost blue LED for connection
- 2 unterschiedliche GerΓ€te melden in Minutenabstand "Multicast (re)joined"
- CORS command not working HOT 7
- Moes 2 gang zigbee 3 dimmer switch MS-105BZ not being fully recognised by Tasmota HOT 1
- How to add something in Tasmota Documentation HOT 1
- Incorrect power measurement on Shelly Puls PM Mini HOT 5
- SwitchMode 6 TOGGLE CMD on the wrong edge HOT 1
- Berry energy.read outputs invalid JSON (nan issue) HOT 14
- ESP32 and PZEM-004T v3 working intermittently HOT 2
- Documentation for comands 'subscribe' and 'subscribe2' is swapped HOT 1
- Add a new ZbState called ZbLoaded to indicate that all ZbDevices and ZbLoads have been loaded successfully. HOT 5
- A4988_Stepper , Motor commands doesnt give feedback while called without argument. Motor MIS not working ? HOT 2
- Berry script not returning sensors values in a given condition HOT 5
- Timers not working after power loss because time resets
- Web-UI does not load (v13.4.1.2 on ESP8266EX) HOT 5
- Events and arrays with mqtt
- Compiling tasmota32 fails
- KNX Support : Latest commit in development branch introduced a regression when using DHT11 sensor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tasmota.