stefanthoss / esphome-aranet4

Read data from an Aranet4 CO2 sensor and expose it in Home Assistant
BSD 2-Clause "Simplified" License
15 stars 0 forks source link

How to get MAC address? #3

Closed ithinkihaveacat closed 1 year ago

ithinkihaveacat commented 1 year ago

Can you explain in a bit more detail how to get the MAC address of the aranet4 device, for input into the configuration? I can successfully connect using both nRF Connect and LightBlue, but the MAC address doesn't seem to be listed. I can see some details just fine, so I think it's connecting:

IMG_941985871699-1

Similarly pairing my phone seems to work, but the MAC address is not listed in settings.

ithinkihaveacat commented 1 year ago

The Android version of LightBlue show the MAC address under "Device Address" in the "Device Information" section.

ThinkPadNL commented 1 year ago

And if you don't have Android, you can also connect the sensor to a Windows laptop over Bluetooth and go to: Control Panel>Hardware and Sound>Devices and Printers right click the Aranet4 there, go to the tab 'Connected Device' and find the field 'Unique Identifier'.

deepcoder commented 1 year ago

If you have a Linux machine the following works well for me:

https://github.com/hbldh/bleak
user@ud-22-10-01:~/bleak$ pwd
/home/user/bleak

pip install bleak

python3

import asyncio
from bleak import BleakScanner

async def main():
    devices = await BleakScanner.discover()
    for d in devices:
        print(d)

asyncio.run(main())
C6:3A:3D:99:F6:FF: SpotLED_F6FF
3D:6A:C3:29:32:8C: 3D-6A-C3-29-32-8C
18:C9:63:C8:FE:CA: LEDnetWF616699C8FEC9
33:99:28:63:32:FE: 33-99-28-63-32-FE
A6:3A:3D:99:F2:36: SpotLED_F236
3F:9C:F2:98:12:CE: 3F-9C-F2-98-12-CE
2D:EE:33:99:A9:C6: 2D-EE-33-99-A9-C6
4F:28:23:23:C4:93: 4F-28-23-23-C4-93
A4:C1:98:DD:CF:AD: ATC_DDCFAD
C8:39:CD:91:FF:F3: C8-39-CD-91-FF-F3
32:34:CE:39:CE:DA: 32-34-CE-39-CE-DA
29:21:ED:C9:CC:A2: 29-21-ED-C9-CC-A2
3A:4D:2E:62:34:2C: 3A-4D-2E-62-34-2C
FA:26:93:29:AC:31: Aranet4 63A24
3F:82:CE:26:34:22: 3F-82-CE-26-34-22
9F:61:22:3A:1C:C1: 9F-61-22-3A-1C-C1
2C:18:89:CF:62:CA: 2C-18-89-CF-62-CA
E6:12:1D:22:86:22: Govee_H3624_8622
FF:FF:31:32:64:63: NEMR31326463
D2:A9:AC:92:41:C9: Aranet4 6A9CF
E3:CC:9C:28:CD:D2: E3-CC-9C-28-CD-D2
32:49:63:36:64:9D: RadiaCode-162#RC-162-661683
C2:2C:3F:C2:29:3F: C2-2C-3F-C2-29-3F
E1:12:CC:69:DE:AC: E1-12-CC-69-DE-AC
6F:13:32:DE:43:91: 6F-13-32-DE-43-91
48:39:34:64:DF:FC: Hello Fairy-DFFC
9F:43:6D:96:F6:14: Govee_H3632_F614
FA:C8:9C:D3:16:2C: FA-C8-9C-D3-16-2C
FF:FF:31:31:89:39: NEMR31318939
22:4C:D9:AA:43:AF: 22-4C-D9-AA-43-AF
36:8A:63:94:29:ED: TY
3C:83:2E:C6:42:66: Flower care
ED:89:33:42:1F:6A: N63HZ
9F:43:6D:86:D8:93: Govee_H3632_D893
3C:1E:1C:94:C4:92: 3C-1E-1C-94-C4-92
A4:C1:98:EC:CE:34: ATC_ECCE34
33:29:3C:84:F6:86: 33-29-3C-84-F6-86
9F:43:6D:81:96:F8: Govee_H3632_96F8
29:DD:3D:6F:2D:A2: 29-DD-3D-6F-2D-A2
A4:C1:98:33:A3:D6: ATC_33A3D6
A4:C1:98:FF:CD:3C: GVH3622_CD3C
C1:46:39:69:9E:E3: N62RZ
41:36:2F:D2:6A:22: 41-36-2F-D2-6A-22
C6:D4:9C:9E:21:A8: C6-D4-9C-9E-21-A8
D9:C4:42:8D:9D:FA: D9-C4-42-8D-9D-FA