ESP32 based BLE tracking for mqtt_room

hi ptrsnja,
My esp32 worked, MQTT connected and data sent but hassio couldn’t recieve any data. Here is my configuration setting:
‘’’’
binary_sensor:

  • platform: mqtt
    name: esp32_living_room
    state_topic: “presence_nodes/living_room”
    json_attributes_topic: “presence_nodes/living_room/tele”
    payload_on: “CONNECTED”
    payload_off: “DISCONNECTED”
    device_class: connectivity
    ‘’’’
    and

‘’’’
sensor:

  • platform: mqtt_room
    device_id: “4544565656456”
    name: ‘xxxxxxx’
    state_topic: ‘living_room’
    timeout: 60
    away_timeout: 120
    ‘’’’
    something wrong, could you help?

If it’s connected and reporting to your mqtt server, then it’s just an issue with your home assistant configuration. Check out the troubleshooting section in the documentation. https://jptrsn.github.io/ESP32-mqtt-room/troubleshooting.html

How fast does this update in home assistant?

It can depend on the system on which home assistant is running, but it should be a matter of a couple seconds. Check the docs at https://www.home-assistant.io/components/mqtt_room/

1 Like

Thanks ptrsnja, it’s ok now.

Hi everybody.
I have problem in compilation with arduino ide due to ArduinoJson.h Library…could somebody please help me? thanks and congratulation for your work!
Stefano.

You need to use PlatformIO to build and upload the project. Support for the Arduino IDE was deprecated early on in the project. I use the Atom IDE with PlatformIO, although they now recommend using VSCode.

You can download/install it here. It’s free and open source, so you won’t need to pay for a license or anything. There are also links in the requirements section of the project’s docs.

Hi! damn, I’ve just started to undestand arduino ide to upload projects to ESP8266 and ESP32…is there something stupidproof to show me in order to let me make the job (quite) easily?
thank you very much…

Take a look at this video: https://www.youtube.com/watch?v=0poh_2rBq7E&t=605s

Andreas’ channel is a really good resource, I’d strongly recommend subscribing if you’re interested in this stuff. He’s taught me quite a bit.

oh!!! After some hours I read your post, and after change to Json instead of JSON it compiled! Thanks!

Oh yeah! I was already following the “guy with the swiss accent” on youtube…
I’ve successfully installed microsoft VSC with PlatformIO installed…now it’s time to integrate this project…it will be the next step…for example, I didn’t find yet a way for integrate the Arduino Libraries such as “PubSubClient.h” for example. Could you give me some suggestions to do so?
thanks a Lot.

Take a look at platformio.ini in the repository. There’s a field in that file called lib_deps which is where you can list project-level libraries required. You can specify a general library, a minimum version, or an exact version.

ok, but must I make this job once, may I use directly the project? For use the repository, may I link it directly on platformio?
please give me some tricks…:slight_smile:

When you build the project with PlatformIO, it will automatically find and download the required libraries. This is one of the reasons why I chose to use this over the Arduino IDE - it removes libraries from the list of things you need to worry about.

I’m not sure what you’re asking. To use this project, you just need to clone or download the repository from GitHub, and open the folder on your local machine using VSCode IDE. Once you’ve done that, you should see the option to build and upload in the PlatformIO menu.

If I haven’t answered your question, can you rephrase it?

You were so perfect! now It misses Just to play!!!

hi everybody! I was able to add everything on my hassio, great! BUT…i need something to track…is there a way to see the MAC of the tracked and sent devices from ESP32? to make test I have a BLE heartbeat sensor made from polar, in your opinion can I use it as tester?

Take a look at the troubleshooting section of the docs, it should help you find the device ID to track it. https://jptrsn.github.io/ESP32-mqtt-room/troubleshooting.html

You can use the mosquitto_sub command to see what the ESP32 is reporting.

Im’ sorry but is not so clear for a noob like me how to get in my hassio istance this kind of board.image .

how may I get it? thanks.

This is the binary sensor screen. To get this view, you need to add the binary sensor to a card in the front end, then click on it.

For the sensor config, check out this page in the docs.

You’ll need to add whatever you’ve called your binary sensor to a card in the front end. Create a glance card, and add the binary sensor to it. Here’s what the yaml should look like:

entities:
  - entity: binary_sensor.esp32_a
    name: Office
show_icon: true
show_state: false
title: Sensor Nodes
type: glance

Uh! I didn’t see the configuration before now…sorry! thanks!

edit: but, can I do this stuff for every MQTT devices in my net? How?