arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.2k stars 4.81k forks source link

Question about MQTT subscriptions #1803

Closed SGF-Lon closed 6 years ago

SGF-Lon commented 6 years ago

Looking at some tracing logs, I can see the following MQTT subscriptions after a restart. Anyone know what the purpose of MQTT topic #012 (see last log entry) is ? I'm not even sure if it's formatted correctly (i.e. is it missing a '/' ) ??

Anyone have any insight?

The device is a Sonoff Touch 2 channel & the firmware is 5.10.0

Feb 5 14:10:14 Dev_7588 ESP-MQT: Connected Feb 5 14:10:14 Dev_7588 ESP-MQT: Sonoff/tele/Sonoff_7588/LWT = Online (retained) Feb 5 14:10:14 Dev_7588 ESP-MQT: Sonoff/cmnd/Sonoff_7588/POWER = Feb 5 14:10:14 Dev_7588 ESP-MQT: Subscribe to Sonoff/cmnd/Sonoff_7588/# Feb 5 14:10:14 Dev_7588 ESP-MQT: Subscribe to Sonoff/cmnd/sonoffs/# Feb 5 14:10:14 Dev_7588 ESP-MQT: Subscribe to cmnd/DEV_7588#012/#

ionciubotaru commented 6 years ago

Tasomta sends an empty message to Sonoff/cmnd/Sonoff_7588/POWER to be sure that any prevoius retain power state message is deleted. Sending empty messages is the only way you tell the MQTT server to delete a retained message.

arendst commented 6 years ago

Actually the message POWER= without result is a request of the HomeBridge community to let HomeBridge know the basic command to toggle power for this device.

The last subscription is the fallback topic made up from the default ClientId. Where the #12 comes in beats me but it should probably be hex 0C.

A "normal" log 3 looks like this:

10:27:15 MQT: Connected
10:27:15 MQT: tele/pzem/LWT = Online (retained)
10:27:15 MQT: cmnd/pzem/POWER = 
10:27:15 MQT: Subscribe to cmnd/pzem/#
10:27:15 MQT: Subscribe to cmnd/sonoffs/#
10:27:15 MQT: Subscribe to cmnd/DVES_0CA8BA/#
SGF-Lon commented 6 years ago

Thanks for the information @arendst @ionciubotaru . The POWER command isn't a problem - although it does cause Openhab to hiccup. However, if the last subscription is the fallback topic - then it clearly doesn't use the MQTT_FULLTOPIC from user_config.h. This should probably be highlighted in the wiki & documentation. The #012 is still a mystery and worth investigating as it makes it difficult to use the fallback topic as documented with a larger number of devices.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.