mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-21 09:46:31 +00:00
Fix Zigbee Time and add TimeEpoch
This commit is contained in:
parent
9d86c15685
commit
0bfb79e694
@ -136,7 +136,7 @@ ZF(MainsVoltage) ZF(MainsFrequency) ZF(BatteryVoltage) ZF(BatteryPercentage)
|
|||||||
ZF(CurrentTemperature) ZF(MinTempExperienced) ZF(MaxTempExperienced) ZF(OverTempTotalDwell)
|
ZF(CurrentTemperature) ZF(MinTempExperienced) ZF(MaxTempExperienced) ZF(OverTempTotalDwell)
|
||||||
ZF(SceneCount) ZF(CurrentScene) ZF(CurrentGroup) ZF(SceneValid)
|
ZF(SceneCount) ZF(CurrentScene) ZF(CurrentGroup) ZF(SceneValid)
|
||||||
ZF(AlarmCount) ZF(Time) ZF(TimeStatus) ZF(TimeZone) ZF(DstStart) ZF(DstEnd)
|
ZF(AlarmCount) ZF(Time) ZF(TimeStatus) ZF(TimeZone) ZF(DstStart) ZF(DstEnd)
|
||||||
ZF(DstShift) ZF(StandardTime) ZF(LocalTime) ZF(LastSetTime) ZF(ValidUntilTime)
|
ZF(DstShift) ZF(StandardTime) ZF(LocalTime) ZF(LastSetTime) ZF(ValidUntilTime) ZF(TimeEpoch)
|
||||||
|
|
||||||
ZF(LocationType) ZF(LocationMethod) ZF(LocationAge) ZF(QualityMeasure) ZF(NumberOfDevices)
|
ZF(LocationType) ZF(LocationMethod) ZF(LocationAge) ZF(QualityMeasure) ZF(NumberOfDevices)
|
||||||
|
|
||||||
@ -283,6 +283,7 @@ const Z_AttributeConverter Z_PostProcess[] PROGMEM = {
|
|||||||
{ Zuint32, Cx000A, 0x0007, Z(LocalTime), 1, Z_Nop },
|
{ Zuint32, Cx000A, 0x0007, Z(LocalTime), 1, Z_Nop },
|
||||||
{ ZUTC, Cx000A, 0x0008, Z(LastSetTime), 1, Z_Nop },
|
{ ZUTC, Cx000A, 0x0008, Z(LastSetTime), 1, Z_Nop },
|
||||||
{ ZUTC, Cx000A, 0x0009, Z(ValidUntilTime), 1, Z_Nop },
|
{ ZUTC, Cx000A, 0x0009, Z(ValidUntilTime), 1, Z_Nop },
|
||||||
|
{ ZUTC, Cx000A, 0xFF00, Z(TimeEpoch), 1, Z_Nop }, // Tasmota specific, epoch
|
||||||
|
|
||||||
// RSSI Location cluster
|
// RSSI Location cluster
|
||||||
{ Zdata8, Cx000B, 0x0000, Z(LocationType), 1, Z_Nop },
|
{ Zdata8, Cx000B, 0x0000, Z(LocationType), 1, Z_Nop },
|
||||||
|
@ -866,7 +866,8 @@ void Z_AutoResponder(uint16_t srcaddr, uint16_t cluster, uint8_t endpoint, const
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 0x000A: // Time
|
case 0x000A: // Time
|
||||||
if (HasKeyCaseInsensitive(json, PSTR("Time"))) { json_out[F("Time")] = Rtc.utc_time; }
|
if (HasKeyCaseInsensitive(json, PSTR("Time"))) { json_out[F("Time")] = (Rtc.utc_time > (60 * 60 * 24 * 365 * 10)) ? Rtc.utc_time - 946684800 : Rtc.utc_time; }
|
||||||
|
if (HasKeyCaseInsensitive(json, PSTR("TimeEpoch"))) { json_out[F("TimeEpoch")] = Rtc.utc_time; }
|
||||||
if (HasKeyCaseInsensitive(json, PSTR("TimeStatus"))) { json_out[F("TimeStatus")] = (Rtc.utc_time > (60 * 60 * 24 * 365 * 10)) ? 0x02 : 0x00; } // if time is beyond 2010 then we are synchronized
|
if (HasKeyCaseInsensitive(json, PSTR("TimeStatus"))) { json_out[F("TimeStatus")] = (Rtc.utc_time > (60 * 60 * 24 * 365 * 10)) ? 0x02 : 0x00; } // if time is beyond 2010 then we are synchronized
|
||||||
if (HasKeyCaseInsensitive(json, PSTR("TimeZone"))) { json_out[F("TimeZone")] = Settings.toffset[0] * 60; } // seconds
|
if (HasKeyCaseInsensitive(json, PSTR("TimeZone"))) { json_out[F("TimeZone")] = Settings.toffset[0] * 60; } // seconds
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user