mirror of https://github.com/arendst/Tasmota.git
Merge pull request #9142 from blakadder/deviceid
add %DEVICEID% to possible rule variables
This commit is contained in:
commit
2891628de1
|
@ -719,6 +719,9 @@ bool RuleSetProcess(uint8_t rule_set, String &event_saved)
|
||||||
RulesVarReplace(commands, F("%UPTIME%"), String(MinutesUptime()));
|
RulesVarReplace(commands, F("%UPTIME%"), String(MinutesUptime()));
|
||||||
RulesVarReplace(commands, F("%TIMESTAMP%"), GetDateAndTime(DT_LOCAL));
|
RulesVarReplace(commands, F("%TIMESTAMP%"), GetDateAndTime(DT_LOCAL));
|
||||||
RulesVarReplace(commands, F("%TOPIC%"), mqtt_topic);
|
RulesVarReplace(commands, F("%TOPIC%"), mqtt_topic);
|
||||||
|
char unique_id[7];
|
||||||
|
snprintf_P(unique_id, sizeof(unique_id), PSTR("%06X"), ESP_getChipId());
|
||||||
|
RulesVarReplace(commands, F("%DEVICEID%"), unique_id);
|
||||||
#if defined(USE_TIMERS) && defined(USE_SUNRISE)
|
#if defined(USE_TIMERS) && defined(USE_SUNRISE)
|
||||||
RulesVarReplace(commands, F("%SUNRISE%"), String(SunMinutes(0)));
|
RulesVarReplace(commands, F("%SUNRISE%"), String(SunMinutes(0)));
|
||||||
RulesVarReplace(commands, F("%SUNSET%"), String(SunMinutes(1)));
|
RulesVarReplace(commands, F("%SUNSET%"), String(SunMinutes(1)));
|
||||||
|
|
Loading…
Reference in New Issue