I have a motion sensor that publishes its states to a MQTT broker. There a two possible messages:
alarm: HomeSecurity: Motion Detection - Unknown Location
alarm: HomeSecurity: Event cleared: Motion Detection - Unknown Location, arg 0108
I am trying set up a text (string) on my sitemap for testing purposes that either shows
‘Motion detected’
‘No motion detected’
Item:
String eg_flur_multiSensor “Bewegungsmelder” {mqtt=“<[mosquitto:eg/flur/multiSensor:state:MAP(multiSensor_configBinding.map)]”}
.map file
alarm: HomeSecurity: Motion Detection - Unknown Location=Motion detected
alarm: HomeSecurity: Event cleared: Motion Detection - Unknown Location, arg 0108=No motion detected
sitemap:
sitemap test label=“Test-Umgebung” {
Frame label="Flur" { Text item=eg_flur_multiSensor }
}
This is not working, and apparently the mapping isn’t done correctly as one can see in the log:
2017-07-08 22:01:57.924 [WARN ] [rm.AbstractFileTransformationService] - Could not transform ‘alarm: HomeSecurity: Motion Detection - Unknown Location’ with the file ‘multiSensor_configBinding.map’ : Target value not found in map for ‘alarm: HomeSecurity: Motion Detection - Unknown Location’
I guess I need to change the mapping using some regular expressions. However, I am not familiar with regex. Anybody out there with a solution?