Example on setting up esp32 as BLE server?

I got the answer from someone smart in another group. I was converting Int instead of Float. That’s what works for me:

  on_ble_manufacturer_data_advertise:
    - mac_address: #your MAC address
      manufacturer_id: FFFF
      then:
        - lambda: |-
            float value = *((float*)&x[1]);
            id(ble_sensor).publish_state(value);

wasn’t that suggested to you right here?

I did write I understand but didn’t know how to do it, see below.

Nonetheless, you helped a lot with answers like this:

Fallingaway24Justin6d
It tells you in the docs how to set up devices, scan for devices, etc…

Or this:

Fallingaway24Justin6d
Have you asked the people in the discord server?

Thanks for pointing out that too, very helpful:

Fallingaway24Justin6d
wasn’t that suggested to you right here?

I just really want to thank you for the great help you provided. I didn’t know what I would do without you.

Hopefully my reply helps someone else that is not that good on coding.

Sorry for reviving this!

It looks like the get_advertising doesn’t exist anymore, and I’m trying to send advertisement data, tried to search for it for multiple evenings and tried to find out how it all would work. This post seems to be the closest thing, except that it doesn’t compile anymore.

If anybody would could try to check if this is the case, and if there is an alternative, thanks!

[esp32_ble_server] Send advertisements with data - ESPHome - Home Assistant Community

Hi

I am trying to emulate a Xiaomi Mijia BLE temperature sensor using an ESP32 and ESPHome. Could anyone please let me know the device name Xiaomi uses, and maybe a screen capture like below showing me under which headings the temperature / humidity and battery level data appears?

My use case is I already have an ESP32 with an indoor temperature sensor, and I would like to send this data to a ‘Faikin’ (Daikin heat pump controller) uisng BLE. The Faikin will accept temperature data from a Xiaomi Mi - which is why I am trying to emulate that device.

Thank you

Interesting idea. Exactly which xiaomi device do you need to emulate. Saying “xiaomi mi” just throws is into a cesspool of similarly named devices.

Got it sorted…
Just needed to send a data stream like this