g-TAG over BLE to ESP32 over WIFI to MQTT/Openhab

mqtt
ble
esp32
Tags: #<Tag:0x00007fe05d964660> #<Tag:0x00007fe05d9644d0> #<Tag:0x00007fe05d964368>

(Daniel N.) #1
  • Platform information: RPI3
    • OS: openhabian latest
    • openHAB version: Openhab 2.4 latest

Hello everybody,

is it possible to detect presence (BLE) via an ESP32? I found some instructions, but I’m new to the field and I’m not quite sure.

I would like to detect a g-TAG with the ESP32 via Bluetooth (BLE) and send Informations (presence) via WLAN / MQTT to pi3 / openhab.

Is that possible? Does anyone have a step by step guide?

thanks for help

Daniel


(Vincent Regaud) #2

Yes


(Daniel N.) #3

Hello everybody,

After a few hours, I got the ESP32 up and running. I still have the following problem, in the Mqtt comes the information about RSSI and distance, but above hab does not take this.
What am I doing wrong?

> home/presence/BLEGateway {"id":"7c:2f:80:8e:xx:xx","manufacturerdata":"▒4▒▒▒Ȼ▒","rssi":-74,"distance":5.270232}
> Number  nogone_tag_rssi     "Daniel Empfang [%d %%]"                            <wlan>      (gPresenc)              {mqtt="<[broker:home/presence/BLEGateway/7c2f808exxxx:state:JSONPATH($.rssi)]"}
> Number  nogone_tag_dis      "Daniel Entfernung [%.2f m]"                        <wlan>      (gPresenc)              {mqtt="<[broker:home/presence/BLEGateway/7c2f808exxxx:state:JSONPATH($.distance)]"}

thanks for help


(Vincent Regaud) #4

This is mqttv1 syntax
Your are using openHAB 2.4. Which version of the mqtt binding are you using?


(Daniel N.) #5

I use the old MQTT V1.13.0


(Vincent Regaud) #6

Your mqtt.cfg, please


(Daniel N.) #7

broker.url=tcp://openhabxxxxxx:1883
broker.clientId=OpenHAB2
broker.user=openhabian
broker.pwd=xxxxxxxxxx
broker.qos=0
broker.retain=true
broker.async=false

All othe Sonoffs and shellys work, only the Data from ESP32 - Presenc dont work


(Vincent Regaud) #8

Ok, so the problem is not MQTT…

Do you use an MQTT tool like MQTTfx?
What topics are being published by the ESP32 and what payloads? Exactly. Thanks


(Daniel N.) #9

oh sorry, in the Mqtt comes the information about RSSI and distance

home/presence/BLEGateway {“id”:“7c:2f:80:8e:xx:xx”,“manufacturerdata”:“▒4▒▒▒Ȼ▒”,“rssi”:-74,“distance”:5.270232}

but in openhab the items

Number  nogone_tag_rssi     "Daniel Empfang [%d %%]"                            <wlan>      (gPresenc)              {mqtt="<[broker:home/presence/BLEGateway/7c2f808exxxx:state:JSONPATH($.rssi)]"}
Number  nogone_tag_dis      "Daniel Entfernung [%.2f m]"                        <wlan>      (gPresenc)              {mqtt="<[broker:home/presence/BLEGateway/7c2f808exxxx:state:JSONPATH($.distance)]"}

don’t take the payload.


(Vincent Regaud) #10

The topic is incorrect

{mqtt="<[broker:home/presence/BLEGateway:state:JSONPATH($.rssi)]"}

(Daniel N.) #11

Ok, what would that be the right topic?

{mqtt="<[broker:home/presence/BLEGateway…??


(Vincent Regaud) #12

You posted it yourself above: