ESPresense an Room Assistant together

Hi there,

how is it possible to bring ESPresense and Room Assistant devices together?

I have two Raspberrys with Room Assistant and two ESP32 with ESPresense.

How can they interact together?
Could it be that mqtt room is a possibility?

Thanks - and yes - this is my first post :sunglasses:

Hello @nukleuz80, I’m trying to achieve the same and I use mqtt_room platform. The problem is that the 2 systems use different ids for the BLE beacons, so there is no easy way to have a consistent report of distance for the same device. Is there someone who found a solution ?

Thanks for input

I‘ve got a solution and will send it later…

I´m using this to create a new tracker with two rooms:

- alias: Mein Alias Device Tracker
  description: ""
  trigger:
    - platform: state
      entity_id:
        - sensor.tile_black_you_are_in_2
        - sensor.tile_black_you_are_in
    - platform: template
      value_template: "{{ state_attr('sensor.tile_black_you_are_in', 'distance')  }}"
    - platform: template
      value_template: "{{ state_attr('sensor.tile_black_you_are_in_2', 'distance')  }}"
  condition: []
  action:
    - service: device_tracker.see
      data:
        dev_id: tileblack
        source_type: bluetooth_le
        location_name:
          "{% if states('sensor.tile_black_you_are_in_2') == 'keller' and
          states('sensor.tile_black_you_are_in') == 'not_home' %}\n  Keller \n{% elif
          states('sensor.tile_black_you_are_in_2') == 'keller' and states('sensor.tile_black_you_are_in')
          == 'Terrasse' %}\n  {% if state_attr('sensor.tile_black_you_are_in_2', 'distance')|float
          < state_attr('sensor.tile_black_you_are_in', 'distance')|float %}\n    KellerD\n
          \ {% elif state_attr('sensor.tile_black_you_are_in_2', 'distance')|float >
          state_attr('sensor.tile_black_you_are_in', 'distance')|float %}\n    TerrasseD\n
          \ {% endif %}  \n{% elif ( states('sensor.tile_black_you_are_in') == 'Terrasse'
          ) and ( states('sensor.tile_black_you_are_in_2') == 'not_home' ) %}\n  Terrasse-Garten\n{%
          elif states('sensor.tile_black_you_are_in_2') == 'keller' %}\n  Kellerr\n{%
          elif states('sensor.tile_black_you_are_in') == 'Terrasse' %}\n  Terrasse-Gartenn
          \                    \n{% elif ( states('sensor.tile_black_you_are_in') ==
          'not_home' ) and ( states('sensor.tile_black_you_are_in_2') == 'not_home'
          ) %}\n  not_home                                     \n{% else %}\n  unknown\n{%
          endif %}\n"
  mode: single

and these sensors with MQTT Room:

  - platform: mqtt_room
    device_id: ble-fe1160fedd11 #Mac Address of device wanting to track
    unique_id: tile_jan_anwesenheit
    name: tile_black_you_are_in # home assistant will show a sensor named (tile_jan_anwesenheit) with its value being the name you gave the gateway
    state_topic: "espresense/rooms"
    timeout: 10
    away_timeout: 60

  - platform: mqtt_room
    device_id: tile:fe1160fedd11 #Mac Address of device wanting to track
    unique_id: tile_jan_anwesenheit2
    name: tile_black_you_are_in2 # home assistant will show a sensor named (tile_jan_anwesenheit) with its value being the name you gave the gateway
    state_topic: "espresense/rooms"
    timeout: 10
    away_timeout: 60