Skip to content

Support home brew DIY sensors #548

@Ernst79

Description

@Ernst79

Request by @scrambledleek to create support for home brew BLE sensors. BLE monitor should:

  • define a BLE format to be used by the home brew sensor
  • automatically generate the HA sensors that are send in the BLE format (and not pre-define them in const.py)

Excellent work on this HA integration! Earlier in the year I had a go at putting together an ESP32 pulse counter to monitor my 'dumb' electricity and gas meters. I decided I'd like to send the data back to HA using bluetooth rather than WiFi (ESPHome could have done it via WiFi with a lot less effort I think!), so thought I'd try and do it via advertisements and the ble_monitor integration.

When adding my pulse counter I thought it might be nice to make something flexible so people could create 'homebrew' devices that might be advertising anything, e.g. some temperatures, humidities, pulse counts, etc. all from one device & in one advertisement.

All I've actually implemented is a 3x pulse counter device, so I've not added the data types for anything other than a 32-bit count.

My implementation doesn't fit perfectly into the ble_monitor though - I couldn't see a nice way to receive multiple sensors of the same data type in a single advertisement/from a single device, so my current hack is to append my counter sensors sequentially to the sensors list...which only works for the counters I'm using, and would not be flexible at all if you had multiple temperatures coming in, or multiples of other different sensor types.

If you would like to take a look I've put what I have on github here, but it's definitely not something you'd want to merge as it is!
https://github.com/scrambledleek/ha_hacs_ble_monitor/tree/homebrew-devel

Perhaps you'd have an idea of a good way to support multiple sensors of the same type coming from a device without a big rework...

Metadata

Metadata

Assignees

No one assigned

    Labels

    new sensorRequest for a new sensor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions