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

Added passing the gateway ID #636

Merged
merged 3 commits into from
Jan 19, 2022
Merged

Conversation

dmamontov
Copy link
Contributor

Added passing the gateway ID to determine exactly which gateway caught the device, particularly useful for identifying people in the room.

Example for myhomeiot/esphhome-components:

esphome

.....

external_components:
  - source: github://myhomeiot/esphome-components
  - source: github://pr#2854
    components: [esp32_ble_tracker]

esp32_ble_tracker:

ble_gateway:
  devices:
    - mac_address: ...
  on_ble_advertise:
    then:
      homeassistant.event:
        event: esphome.on_ble_advertise
        data:
          packet: !lambda return packet;
          gateway_id: gateway_hall_1

hass

- alias: ESPHome BLE Advertise
  mode: queued
  trigger:
    - platform: event
      event_type: esphome.on_ble_advertise
  action:
    - service: ble_monitor.parse_data
      data:
        packet: "{{ trigger.event.data.packet }}"
        gateway_id: "{{ trigger.event.data.gateway_id }}"

Copy link
Collaborator

@Ernst79 Ernst79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get one error is the HASSFEST test

Integrations: 1
Invalid integrations: 1

Integration ble_monitor - custom_components/ble_monitor:
Error: R] [SERVICES] Invalid services.yaml: required key not provided @ data['parse_data']['fields']['gateway_id']['description']. Got None

Error: Process completed with exit code 1.

@dmamontov
Copy link
Contributor Author

I get one error is the HASSFEST test

Integrations: 1
Invalid integrations: 1

Integration ble_monitor - custom_components/ble_monitor:
Error: R] [SERVICES] Invalid services.yaml: required key not provided @ data['parse_data']['fields']['gateway_id']['description']. Got None

Error: Process completed with exit code 1.

Added description

@Ernst79
Copy link
Collaborator

Ernst79 commented Jan 19, 2022

That was fast, looks good BTW. Thanks. Does this need some explanation in the documentation?

@dmamontov
Copy link
Contributor Author

That was fast, looks good BTW. Thanks. Does this need some explanation in the documentation?

Just in case, I updated the documentation and added an example.

@Ernst79 Ernst79 merged commit b573186 into custom-components:master Jan 19, 2022
@Ernst79
Copy link
Collaborator

Ernst79 commented Jan 19, 2022

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants