Github Boards Devices Community Docs Blog

Need guidance with HASS mqtt_room with M5Stack and iBeacon

I run HASS and a M5Stack OMG using HASS discovery, the OMG shows up in HASS automatically. I have an iBeacon and am experimenting with the mqtt_room integration for room presence detection.

Target: I would like the HASS sensor.ibeacon to show the omg name myroom if the iBeacon is in the same room with the OMG.

This is the configration for mqtt_room:

sensor:
  - platform: mqtt_room
    state_topic: "home/home_presence"
    timeout: 5
    away_timeout: 600
    name: "ibeacon"
    device_id: "xx:xx:redacted"

Here are the setting for the OMG:

{"lowpowermode":1,"hasspresence":true,"interval":1,"onlysensors":false,"bleconnect":false,"minrssi":-75}

Now some thigns do not seem to work as expected, and I would like to better understand why that is and how to do it better:

  • why does home/homepresence/myroom only contain 1 device, even if there are several devices in the room? Is that a requirement of the mqtt_room integration? Will HASS anyway detect more than 1 device per room, if the corresponding sensors are defined?

  • why is the minrssi not applied to home/homepresence/myroom? It will contain devices that have a lower rssi. How am I supposed to tune the detection sensitivity for mqtt_room? Note: The rssi filtering does seem to work for BTtoMQTT.

  • just an observation: white-list seems to be applied to home/homepresence/myroom and to BTtoMQTT if specified.

My main problem is that minrssi is not applied to the hasspresence feature.

The observed behavior is the same for version 0.9.5 and 0.9.6.

If you are using 1s as an interval there is little benefit on being on low power mode. You should set this one to 0.

The integration was designed like this for room presence. It may have evolved on HASS side. Let me check how this is working

Is it not possible to do it at HASS level? I think it is voluntary at first for presence detection to don’t have minrssi. The goal is really to detect all the devices going IN and OUT.
Maybe using the white list is a better approach has you have done.

Because the gateway is a pass through, it publishes the mac address seen by the scan and each scan is repeated depending on your configuration settings.
If you define your timeout in the sensor configuration following your OMG setting of scan duration (10s per default) it should work.