diff --git a/mqtt/mqtt.go b/mqtt/mqtt.go index a49466f..f4fe238 100644 --- a/mqtt/mqtt.go +++ b/mqtt/mqtt.go @@ -124,8 +124,8 @@ var subscriptionHandler = func(client MQTT.Client, msg MQTT.Message) { //------------------------------------------------------------------- // create ID from topic - regexpWithType := "\\/ATB\\/[A-Z]+\\/[0-9]+\\/[0-9]+\\/mo" - regexpDefault := "\\/ATB\\/[0-9]+\\/[0-9]+\\/[0-9]+\\/[0-9]+\\/mo" + regexpWithType := "ATB\\/[A-Z]+\\/[\\-]*[0-9]+\\/[\\-]*[0-9]+\\/mo" + regexpDefault := "ATB\\/[0-9]+\\/[\\-]*[0-9]+\\/[\\-]*[0-9]+\\/[0-9]+\\/mo" topicSlice := strings.Split(msg.Topic(), "/")