Another question about migration from mqtt 1.x to 2.4

Hello all
I used this tutorial: https://github.com/ThomDietrich/miflora-mqtt-daemon get data from a miflora sensor in to openhab. Now i would like to have it working under the new mqtt addon.
But the data is being send to Mosquitto trough a JSONPATH and i have no idea what to do.
This is what i have from the mqtt 1.x binding:

.items

// miflora.items - Generated by miflora-mqtt-daemon.
// Adapt to your needs! Things you probably want to modify:
//     Room group names, icons,
//     "gAll", "broker", "UnknownRoom"

// Mi Flora specific groups
Group gMiFlora "All Mi Flora sensors and elements" (gAll)
Group gLightIntensity "Mi Flora Sunlight Intensity elements" (gAll, gMiFlora)
Group gAirTemperature "Mi Flora Air Temperature elements" (gAll, gMiFlora)
Group gSoilMoisture "Mi Flora Soil Moisture elements" (gAll, gMiFlora)
Group gSoilConductivity "Mi Flora Soil Conductivity/Fertility elements" (gAll, gMiFlora)
Group gBattery "Mi Flora Sensor Battery Level elements" (gAll, gMiFlora)

// Mi Flora "miflora1" (C4:7C:8D:66:DB:F0)
Group ghomemiflora1 "Mi Flora Sensor miflora1" (gMiFlora, ghome)
Number home_miflora1_LightIntensity "Sunlight Intensity [%d lux]" <text> (ghomemiflora1, gLightIntensity) {mqtt="<[broker:miflora/miflora1:state:JSONPATH($.light)]"}
Number home_miflora1_AirTemperature "Air Temperature [%.1f °C]" <text> (ghomemiflora1, gAirTemperature) {mqtt="<[broker:miflora/miflora1:state:JSONPATH($.temperature)]"}
Number home_miflora1_SoilMoisture "Soil Moisture [%d %%]" <text> (ghomemiflora1, gSoilMoisture) {mqtt="<[broker:miflora/miflora1:state:JSONPATH($.moisture)]"}
Number home_miflora1_SoilConductivity "Soil Conductivity/Fertility [%d µS/cm]" <text> (ghomemiflora1, gSoilConductivity) {mqtt="<[broker:miflora/miflora1:state:JSONPATH($.conductivity)]"}
Number home_miflora1_Battery "Battery Level [%d %%]" <text> (ghomemiflora1, gBattery) {mqtt="<[broker:miflora/miflora1:state:JSONPATH($.battery)]"}

.sitemap

Text item=home_miflora1_LightIntensity
Text item=home_miflora1_AirTemperature
Text item=home_miflora1_SoilMoisture
Text item=home_miflora1_SoilConductivity
Text item=home_miflora1_Battery

Now do i have the add JSONPATH to the .things file or in the .items file. And how do i do that.
Can someone point me in the right direction.

Greetings

Here is an example for the temperature.

1 Like

Thanks for the reply. This will help me thanks again.

Greetings

I have made my .things and .items trough a file and not the ui. I now receive a error iff i try to add it trough the ui. Is it possible for you to post the code this would have created in the .things and . items files?

Edit:
I no it has to be somthing like:"

Type number : miflora "Miflora" [stateTopic="miflora/miflora1"]

I just don’t no where i have to add the JSONPATH:$.temperature in de code.

Greetings

No. Because Things created via PaperUI don’t populate to any flat text files, they go into the JsonDB, which looks like:

  "label": "Temperature",
  "configuration": {
    "properties": {
      "stateTopic": "miflora/FlowerCareOne",
      "transformationPattern": "JSONPATH:$.temperature"
    }

You may find something in the docs:

1 Like

Okay, maybe i need to start using the ui’s. Will go and read some, thanks for the link and help.

greetings

I have been reading and playing around. Iff i understand the Doc correctly i have to add it like this:

 Type number : miflora "Miflora" [stateTopic="miflora/miflora1", transformationPattern="JSONPATH:$.temperature"]

But i don’t see any data being received in my events.log

Did i made the thing correctly?

Greetings

EDIT:
I see from a different post that you have your mqtt setup.:+1:

If your asking about the eventbus then see this topic.