diff --git a/main.go b/main.go index e9d90bd..8ca41b3 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,4 @@ +// TODO: Make TimescaleDB optional. package main import ( @@ -245,6 +246,15 @@ func mqttMessageHandler(client mqtt.Client, msg mqtt.Message) { } } +// parseDSMRTimestamp parses the timestamp as emitted by the P1 meter +// (YYMMDDhhmmssX, where X is S or W for summer- or wintertime). +// +// More information: +// https://github.com/matthijskooijman/arduino-dsmr/blob/master/README.md +// https://srolija.medium.com/gos-summer-time-localization-issues-4c8ab702806b +// https://github.com/thomasvnl/P1DSMRReader-ESPHome +// https://pkg.go.dev/github.com/mijnverbruik/dsmr#Timestamp.Position +// https://pkg.go.dev/github.com/mijnverbruik/dsmr#Timestamp func parseDSMRTimestamp(t string) (time.Time, error) { // Extract values from timestamp string