MQTT Room Presence: add optional MAC to config

Hi
I have a fitbit which I use in my apartment with Room Presence and as a reliable “I’m home” for certain automations. Over the holidays my HA went back into “I’m home” mode a few times which was a bit of a problem as I was 400+miles away.

Digging into it further I see that the deviceID (sd:0x180a) may be common to other fitbit’s of the same model/colour. I’m thinking the postman or a neighbour may have the same one.

  • The feature request is to have the option to include the device MAC address in the Room Presence config to eliminate the chance of it detecting someone else’s device.

For now as a workaround I went to each device and in the Scanning section I put in the “Known BLE MAC” 13 digit MAC address for my fitbit and then updated the sensors.yaml entry as ESPresense now reports the fitbit as ‘known:123acb321bcax’

That works, but it would be great if it was a single option in the HA sensor config rather than manually going to each ESP32 to set up the filter there.

@callumw
Did you mean 12 digits? I’m trying to configure the same set up as you. I’ve entered in my 12 digit mac and am using the following:

sensor:
  - platform: mqtt_room
    name: "Fitbit Sense BLE"
    device_id: "known:123456789012"
    state_topic: "espresense/rooms"
    timeout: 5
    away_timeout: 60

Also in the ESP Sensor the configuration is:
Known BLE mac addresses (no colons, space seperated):
123456789012 abcdefghijkl

As I have two fitbits

But it’s still not showing up in HomeAssistant, any assistance would be greatly appreciated.

Yes, 12
I eyeballed it, but my code editor confirmed it’s 12 :slight_smile:
This is an example of how 2 could be set up (space inbetween to delineate)

You also need to make sure your HA IP and MQTT username/password are correct in the ESP32 config or it won’t show
then Save + Restart Device

Use MQTT Explorer to connect and talk to your HA MQTT integration and it’ll report on what devices are talking to your ESP32s :+1:

Sample code for sensors.yaml

# MQTT_Room ESP32
- platform: mqtt_room
  name: "Fitbit 1"
  unique_id: 3ca1983f-941a-494a-b03a-b682661aaa23
  device_id: known:651wdw651w51
  state_topic: "espresense/rooms"
  timeout: 5
  away_timeout: 120
- platform: mqtt_room
  name: "Fitbit 2"
  unique_id: 150d2e41-0f1b-413a-819f-b4f497e01d90
  device_id: known:87fw79wf9we7
  state_topic: "espresense/rooms"
  timeout: 5
  away_timeout: 120