Integration of a kitchen fan (Fjäråskupan) into HomeAssistant

Mac is different for every device. Once found though we could use it. I will try to make use of it.

// Edit… This need a bit of a redesign. With one config entry per device, which is something i sort of wanted to avoid.

What name does your device broadcast? Maybe its different?

Ps. Ove had issues with bluez where scanning seem to stop. Can hou restart your host and see if the name filter works after that.

Output from bluetoothctl while running when pressed light button on fan:

[CHG] Device 04:91:62:8C:8E:8E RSSI: -54
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Key: 0x4f48
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Value:
  4f 44 46 4a 41 52 00 02 01 00 00 64 00           ODFJAR.....d.   
[CHG] Device 04:91:62:8C:8E:8E RSSI: -54
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Key: 0x4f48
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Value:
  4f 44 46 4a 41 52 00 02 01 00 00 64 00           ODFJAR.....d.   
[CHG] Device 04:91:62:8C:8E:8E RSSI: -58
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Key: 0x4f48
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Value:
  4f 44 46 4a 41 52 00 02 01 00 00 64 00           ODFJAR.....d.   
[CHG] Device 04:91:62:8C:8E:8E ServicesResolved: no
[CHG] Device 04:91:62:8C:8E:8E Connected: no
[CHG] Device 04:91:62:8C:8E:8E RSSI: -61
[CHG] Device 04:91:62:8C:8E:8E RSSI: -54

sometimes it reads:

[CHG] Device 04:91:62:8C:8E:8E RSSI: -58
[CHG] Device 04:91:62:8C:8E:8E RSSI: -61
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Key: 0x4f48
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Value:
  4f 44 46 4a 41 52 00 02 00 00 00 00 00           ODFJAR.......   
[CHG] Device 04:91:62:8C:8E:8E RSSI: -56
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Key: 0x4f48
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Value:
  4f 44 46 4a 41 52 00 02 00 00 00 00 00           ODFJAR.......   
[CHG] Device 04:91:62:8C:8E:8E RSSI: -58
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Key: 0x4f48
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Value:
  4f 44 46 4a 41 52 00 02 00 00 00 00 00           ODFJAR.......   
[CHG] Device 04:91:62:8C:8E:8E RSSI: -61
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Key: 0x4f48
[CHG] Device 04:91:62:8C:8E:8E ManufacturerData Value:
  4f 44 46 4a 41 52 00 02 00 00 00 00 00           ODFJAR.......   
[CHG] Device 04:91:62:8C:8E:8E RSSI: -58
[CHG] Device 04:91:62:8C:8E:8E RSSI: -58

Output from bluetoothctl when adding integration with UUID and scanning with Mac

# bluetoothctl 
Agent registered
[CHG] Controller 00:1A:7D:DA:71:15 Pairable: yes
[CHG] Controller 00:1A:7D:DA:71:15 Discovering: yes
[NEW] Device 04:91:62:8C:8E:8E 04-91-62-8C-8E-8E
[CHG] Device 04:91:62:8C:8E:8E RSSI is nil
[CHG] Controller 00:1A:7D:DA:71:15 Discovering: no
[CHG] Controller 00:1A:7D:DA:71:15 Discovering: no
[CHG] Controller 00:1A:7D:DA:71:15 Discovering: yes
[CHG] Device 04:91:62:8C:8E:8E RSSI: -57
[CHG] Device 04:91:62:8C:8E:8E RSSI: -57
[CHG] Device 04:91:62:8C:8E:8E RSSI: -60
[CHG] Device 04:91:62:8C:8E:8E RSSI: -60
[CHG] Device 04:91:62:8C:8E:8E RSSI: -53

Integration removed and rebooted:


# bluetoothctl
Agent registered
[CHG] Controller 00:1A:7D:DA:71:15 Pairable: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:DA:71:15 Discovering: yes
[NEW] Device 04:91:62:8C:8E:8E 04-91-62-8C-8E-8E
[bluetooth]# info 04:91:62:8C:8E:8E
Device 04:91:62:8C:8E:8E (public)
   Alias: 04-91-62-8C-8E-8E
   Paired: no
   Trusted: no
   Blocked: no
   Connected: no
   LegacyPairing: no
   UUID: Vendor specific           (77a2bd49-1e5a-4961-bba1-21f34fa4bc7b)
   RSSI: -60

Om my system it seems like Mac is stored in /config/.storage/core.device_registry, but is it stored during config flow?

"identifiers": [
                    [
                        "fjaraskupan",
                        "04:91:62:8C:8E:8E"
                    ]

scan for device name on new reboot:

2022-06-03 16:32:01 DEBUG (MainThread) [bleak.backends.bluezdbus.scanner] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0): ['org.bluez.Adapter1', {'Discovering': <dbus_next.signature.Variant ('b', True)>}, []]
2022-06-03 16:32:06 DEBUG (MainThread) [bleak.backends.bluezdbus.scanner] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0): ['org.bluez.Adapter1', {'Discovering': <dbus_next.signature.Variant ('b', False)>}, []]

Started scan with bluetoothctl and then new try from HA:

2022-06-03 16:39:39 DEBUG (MainThread) [bleak.backends.bluezdbus.scanner] cached devices: {'/org/bluez/hci0/dev_04_91_62_8C_8E_8E': {'Address': '04:91:62:8C:8E:8E', 'AddressType': 'public', 'Alias': '04-91-62-8C-8E-8E', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -53, 'Connected': False, 'UUIDs': ['77a2bd49-1e5a-4961-bba1-21f34fa4bc7b'], 'Adapter': '/org/bluez/hci0', 'ServicesResolved': False}

Ok. Looks like i may have to remove the filter completely. I don’t really like it since if there are many ble devices in proximity it might be quite a lot of traffic.

Do filter affect nearby battery operated devices? then it’s no good.

I don’t think it changes anything from the BLE devices perspective. Only from the scanner. I don’t think bluez is intelligent enough to limit what goes out on radio.

Btw. Not sure if i asked, if you run something like: https://play.google.com/store/apps/details?id=net.alea.beaconsimulator to scan for the fan, does that show a name for the device?

yes with Bluetility

We have now dropped the filter fully. So should work now.

using 2022.6.2 and running perfectly! Thank you very much!

Anyone tried to get this to work out via the new ESPHome Bluetooth Proxy ?

Well, i followed How to turn an ESP32 board into a Bluetooth proxy for Home Assistant | ESPHome Bluetooth Proxies - YouTube
…and then it found the Fjäråskupan integration, great!
However there is no services or entities available so not sure how to use it in HA? What to do?
image

If it sees a hood, a device should show up. It aught to have checked that before you managed to add the integration.

Can you post debug info from the bluetooth integration?

Ok, thanks!
Well, I just left it over the night and suddenly the integration was populated with entities etc. Success! :slight_smile:

I use the standard integration but when i restart ha after a config change the connection is unavailable.
The only workaround is to turn on the light or fan of my hood with the remote and then it appears again in HA.

I found an app (Fjäråskupan) in google play and with that app i can always control the hood.
So it seems to be a ha integration problem.

Maybe the integration forgets the found hood after a restart?

I think i know what causes that. We only get changes for notifications. So maybe we dont get a notification on start. Will check.

Will be solved in next release.

Great!! Thanks in advance…

Tried to set this up today. Got it to work besides the off switch for the light. It just turns off and on again. Changing the brightness to 1% does seem to turn it off so i guess that is a decent workaround…