Not able to update Location

  • Platform information:

    • Hardware: Raspi /1GB RAM/30 GB
    • OS: openhabian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: OH3
  • Issue of the topic: please be detailed explaining your issue
    Not able to update the location in Sitemap

  • Please post configurations (if applicable):


items/lpg.items

Contact Kitchen_Light “Warning”
Number Kitchen_Humidity “LPG Level”
Location Kitchen_Location " Location"
String llpgLocPos {channel=“mqtt:broker:mosquitto:lpgTopic :llpgLoc”}


things/lpg.things

Bridge mqtt:broker:mosquitto [ host=“localhost”, secure=false ]
{
Thing topic lpgTopic {
Channels:
Type string: llpgLoc “LPG Location” [stateTopic="/traccar/lpg1/status"]
}
}


mosquitto_sub

$ mosquitto_sub -t /traccar/lpg1/status

{“latitude”:18.9711486,“longitude”:72.8374287}


sitemaps/lpg.sitemap

sitemap lpg label=“Track-N-Trace” {

Group item=Kitchen_Light
Group item=Kitchen_Humidity

Frame {
Group item=Kitchen_Location

}

}


rules/lpg.rules

rule “Location MQTT”

when
Item llpgLocPos changed
then
logInfo(“LPGTracks”,“MQTT update”)

val String json = llpgLocPos.state

logInfo("LPGTracks MQTT","Inside point")
val String lat  = transform("JSONPATH", "$.lat", json)
val String lon  = transform("JSONPATH", "$.lon", json)

Kitchen_Location.postUpdate(new PointType(lat + "," + lon))

end


sitemaps/lpg.sitemap

sitemap lpg label=“LPG Track-N-Trace”
{
Group item=Kitchen_Humidity
Group item=Kitchen_Light

Frame {
Group item=Kitchen_Location
}

Frame {
Group item=Settings
}
}


  • If logs where generated please post these here using code fences:

2022-03-05 08:14:08.075 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘lpg.rules’

2022-03-05 08:14:51.087 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Item ‘Kitchen_Humidity’ is not a group.
2022-03-05 08:14:51.092 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Item ‘Kitchen_Light’ is not a group.
2022-03-05 08:14:51.095 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Item ‘Kitchen_Location’ is not a group.
2022-03-05 08:14:51.101 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Item ‘Kitchen_Humidity’ is not a group.
2022-03-05 08:14:51.107 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Item ‘Kitchen_Light’ is not a group.
2022-03-05 08:14:51.117 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Item ‘Kitchen_Location’ is not a group.

see element-type-group in sitemap

You do not want to use “Group item=” here …
Instead of Group it should be Default or Text.

SOLVED…

Mapview item=Kitchen_Location

Thanks Wolfgang_S