Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work with ESP nodes #694

Open
kunalgrover05 opened this issue May 11, 2021 · 4 comments
Open

Work with ESP nodes #694

kunalgrover05 opened this issue May 11, 2021 · 4 comments

Comments

@kunalgrover05
Copy link

kunalgrover05 commented May 11, 2021

Is your feature request related to a problem? Please describe.
Support Room assistant with ESP nodes

Describe the solution you'd like
While having bluetooth linux systems around the house is possible, using ESP32 nodes might be much more economical both from an initial cost factor and cost of running them in the long term.

Support ESP nodes that can be used as secondary nodes always but they can use the same configuration as room assistant and work as long as one primary node is up. Potentially they can be based on ESP MQTT and keep publishing the information about RSSI for all the discovered nodes, and room-assistant focuses on the aggregation of that data across sources.

@kalmatthew
Copy link

I really like the idea of this, I'm mainly using Amg8833 chips and if I could get one of these and a battery acting as remote nodes it would make my setup much neater

@freman
Copy link

freman commented Feb 1, 2022

Given the ongoing chip shortage, I absolutely second this - raspberry*.* devices are about as rare as unicorn rocking horse poop around these parts but I can get my hands on esp32's with relative ease (In fact I have a small stockpile as I'm always finding uses for them)

Even if it wasn't a formal integration and just an api we can post {position, rssi, address) to

@kunalgrover05
Copy link
Author

kunalgrover05 commented Feb 1, 2022

I actually got this to work so will document it for everyone's benefit, feel free to add it on Wikis.

Setup

Configuration

  • Room assistant: We will create a sensor which listens to the BLE RSSI values reported by Room assistant in HA configuration.yaml.
sensor:
  - platform: mqtt
    state_topic: "room-assistant/entity/<roomAssistantNodeId>/bluetooth-low-energy-presence-sensor/<trackerId>"
    name: "Bedroom tracker RSSI"
    value_template: "{{ value_json.entity.measuredValues.<roomAssistantNodeId>.rssi }}"
    unit_of_measurement: dB
  • ESPHome: We get a sensor by declaring in espHome.yml
sensor:
  - platform: ble_rssi
    mac_address: AC:37:43:77:5F:4C
    name: "Hall tracker RSSI"
  • We will now define a composite sensor which depends on the above sensors in HA configuration.yaml
template:
    sensor:
      - name: "Tracker location"
        state: > 
          {% set sensors = ['sensor.bedroom_tracker_rssi',  'sensor.hall_tracker_rssi'] %}
          {% set sensorsNames = ['Bedroom', 'Hall'] %}

          {% set data = namespace(new_list=[]) %}
          {% for sensor in sensors %}
             {% set data.new_list = data.new_list + [states(sensor)] %}
          {% endfor %}
    
          {% set min_rssi = min(data.new_list) %}
          {% set sensor_id = data.new_list.index(min_rssi) %}
          {{ sensorsNames[sensor_id] }}    

@ianustec
Copy link

I actually got this to work so will document it for everyone's benefit, feel free to add it on Wikis.

Setup

Configuration

  • Room assistant: We will create a sensor which listens to the BLE RSSI values reported by Room assistant in HA configuration.yaml.
sensor:
  - platform: mqtt
    state_topic: "room-assistant/entity/<roomAssistantNodeId>/bluetooth-low-energy-presence-sensor/<trackerId>"
    name: "Bedroom tracker RSSI"
    value_template: "{{ value_json.entity.measuredValues.<roomAssistantNodeId>.rssi }}"
    unit_of_measurement: dB
  • ESPHome: We get a sensor by declaring in espHome.yml
sensor:
  - platform: ble_rssi
    mac_address: AC:37:43:77:5F:4C
    name: "Hall tracker RSSI"
  • We will now define a composite sensor which depends on the above sensors in HA configuration.yaml
template:
    sensor:
      - name: "Tracker location"
        state: > 
          {% set sensors = ['sensor.bedroom_tracker_rssi',  'sensor.hall_tracker_rssi'] %}
          {% set sensorsNames = ['Bedroom', 'Hall'] %}

          {% set data = namespace(new_list=[]) %}
          {% for sensor in sensors %}
             {% set data.new_list = data.new_list + [states(sensor)] %}
          {% endfor %}
    
          {% set min_rssi = min(data.new_list) %}
          {% set sensor_id = data.new_list.index(min_rssi) %}
          {{ sensorsNames[sensor_id] }}    

Hi,
Thanks so much!

I have two esp32-cam that I would also like to use as a trackers.
I installed RA in HA but I don't understand the MQTT url format to enter.

Where do I find roomAssistantNodeId and trackerId?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants