diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index a6df3402e..0ad53c457 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,18 +1,20 @@ /* 5.14.0a * Add feature information to Status 4 * Add tools folder with python script decode-status.py for decoding some status fields like SetOption and Features - * Add Eastron SDM630 energy meter (#2735) - * Add KNX communication enhancement (#2742) - * Add KNX energy data (#2750) - * Add python script fw-server.py in tools folder to create a simple OTA server (#2759) + * Add Eastron SDM630 energy meter by Gennaro Tortone (#2735) + * Add KNX communication enhancement by Adrian Scillato (#2742) + * Add KNX energy data by Adrian Scillato (#2750) + * Add python script fw-server.py in tools folder to create a simple OTA server by Gennaro Tortone (#2759) * Add rules %mem1% to %mem5% variable names storing data in flash (#2780) * Add rules test on %varx% or %memx% (#2780) + * Add optional token %id% substituting the unique MAC address for topic names by Michael Graf (#2794) * Fix display selection of un-available GPIO options in Module Configuration webpage (#2718) * Fix timer re-trigger within one minute after restart (#2744) - * Fix IRSend not accepting data value of 0 (#2751) - * Fix vars on rules (#2769) - * Fix bug in KNX menu (#2770) + * Fix IRSend not accepting data value of 0 by David Conran (#2751) + * Fix vars on rules by Adrian Scillato (#2769) + * Fix bug in KNX menu by Adrian Scillato (#2770) * Fix anomalies in rules (#2778) + * Fix HUE bridge V1 software version by Heiko Krupp (#2788) * * 5.14.0 20180515 * Update language files @@ -27,13 +29,13 @@ * Fix KNX config error (#2628) * Fix sensor MHZ-19 vanishing data over time (#2659) * Fix KNX reconnection issue (#2679) - * Fix DST and STD time for Southern Hemisphere (#2684, #2714) + * Fix DST and STD time for Southern Hemisphere by Adrian Scillato (#2684, #2714) * Add Portuguese in Brazil language file * Add SetOption26 to enforce use of indexes even when only one relay is present (#1055) * Add support for sensor SI1145 UV Index / IR / Visible light (#2496) * Add rule state test for On/Off in addition to 0/1 (#2613) * Add hardware serial option to MHZ-19 sensor (#2659) - * Add Eastron SDM120 energy meter (#2694) + * Add Eastron SDM120 energy meter by Gennaro Tortone (#2694) * Add user entry DST/STD using commands TimeStd and TimeDst (See wiki for parameter syntax) (#2721) * * 5.13.1 20180501 diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h index ca6ed256c..369fb10cb 100644 --- a/sonoff/sonoff.h +++ b/sonoff/sonoff.h @@ -55,6 +55,7 @@ typedef unsigned long power_t; // Power (Relay) type #define MQTT_TOKEN_PREFIX "%prefix%" // To be substituted by mqtt_prefix[x] #define MQTT_TOKEN_TOPIC "%topic%" // To be substituted by mqtt_topic, mqtt_grptopic, mqtt_buttontopic, mqtt_switchtopic +#define MQTT_TOKEN_ID "%id%" // To be substituted by mqtt_topic, mqtt_grptopic, mqtt_buttontopic, mqtt_switchtopic #define WIFI_HOSTNAME "%s-%04d" // Expands to - diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index a12a710b3..e88c03e7e 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -269,6 +269,9 @@ void GetTopic_P(char *stopic, byte prefix, char *topic, const char* subtopic) } fulltopic.replace(F(MQTT_TOKEN_PREFIX), Settings.mqtt_prefix[prefix]); fulltopic.replace(F(MQTT_TOKEN_TOPIC), topic); + String token_id = WiFi.macAddress(); + token_id.replace(":", ""); + fulltopic.replace(F(MQTT_TOKEN_ID), token_id); } fulltopic.replace(F("#"), ""); fulltopic.replace(F("//"), "/");