Has anyone had any success using the BT Home Hub 5 Device Tracker Component recently?

Also, just to add some more info…found these entries in the HA log:

2018-01-13 18:58:48 ERROR (SyncWorker_2) [homeassistant.components.device_tracker.bt_home_hub_5] Invalid response from Home Hub: <Response [404]>
2018-01-13 18:58:48 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform bt_home_hub_5

@Slap_Ed This home hub module is currently broken. @ha_novice has made some changes in his home assistant files to get it working, which you can try and replicate. I decided to just use nmap and ping.

@Kallb123 thanks for your comment. I took a look at @ha_novice changes, as a noob to HA and complete novice in software coding, I wouldn’t know where to start/place/store the example script.

That said, I have got nmap up and running with just the devices I wish to track/view. I’d be interested in your “ping thing” if you wouldn’t mind sharing.

As an aside, I’l love to get my teeth into MQTT to track and manage my home automation, but it gives me a headache just reading about the topic :wink:

@Slap_Ed my nmap tracker wasn’t picking up my android phone properly, so I had to switch to the ping platform. It just sends out a small message and waits for a reply from the phone. Works just fine. Nmap works fine for the ios devices though, so I have both going at the same time:

device_tracker:
  - platform: nmap_tracker
    hosts: 192.168.101
  - platform: ping
    hosts:
      mydevice: 192.168.1.41

I’ve set mqtt up, just by putting

mqtt:
  discovery: true
  discovery_prefix: homeassistant

In my config file. It works fine and I have one device that interacts with it that way. Wasn’t sure about the prefix and how it effects things, I think the device uses a different prefix but I still managed to add it into the system. I don’t really understand it but it works haha.

@Kallb123 thanks for sharing, I’ll take a look tonight and report back

Hi ha_novice

I followed your notes and copied what you did: Take the bt_home_hub_5.py code and add your modifications (Added the import, changed the URL, changed the _parse_homehub_response function) and saved it as a custom component bt_home_hub_5.py

According to the docs if I create a component with the same name it overrides the built-in one.

However, I now get the error:
ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform bt_home_hub_5

I’m sure this is just something silly and obvious, but I’m brand new to HA. Would appreciate if you could point me in the right direction

Hey guys,

Sorry to revive a seemingly dead thread but I thought I’d update it to let you all know that my pull request that fixes the bt home hub 5 component has just been closed. This should mean the component should be working with the next home assistant update.

Many thanks to @ha_novice for his suggestion on how to fix it as it thoroughly helped me.

Hope you all enjoy!!!

Hi arranhs,

Should the component now be fixed in 0.76.2? I have the component enabled but the device tracking isn’t working.
Upon HA booting up, there’s an error of something (I’m not with HA at the moment) like:

IndexError: list index out of range

I can get the full error later if needed.

Currently new devices aren’t being added and current devices aren’t tracked.

Thanks.

Hi @arranhs,

Im trying with the BT Hub but am coming up stumped. Have you had it working?

Hey guys! I’ve been very busy recently with work so haven’t been able to check out these errors or look at a fix. @trevor.hendo or @theTechnician, if you are finding that you are having trouble with the module working, im just wondering, could you let me know what BT home hub 5 type you have - Type A or Type B? It should say at the bottom of the page when you go to 192.168.1.254 in your browser. This would help debug the problem. Thanks!

1 Like

@arranhs,
I actually have a BT Hub 6A, I believe it still works having read other topics. I may be wrong

Wow … I had no idea you replied, sorry it’s taken this long.
I’ll check when I get home and edit this reply … I know I have a BT Home Hub 5, that’s for sure.

I have a Home Hub 5 Type B

Hey folks - does this work with the BT mesh WiFi system? Thanks! :slight_smile:

Hi @freekeys & All, I have a BT Home Hub 6 Type B and I get a load of Python errors when I try and configure it to track devices. Does it work for you now or anyone else with a BT home hub?

I’ve tried using device type “bt_home_hub_5” and “bt_smarthub” but both types give me the same errors below… I don’t think device tracking works for BT hubs anymore, It used to work when I first setup HA about 6 months ago then all my node red scripts stopped working on mobile devices connecting to my network.

2019-02-10 13:02:25 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform bt_home_hub_5
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/init.py”, line 176, in async_setup_platform
platform.get_scanner, hass, {DOMAIN: p_config})
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/bt_home_hub_5.py”, line 29, in get_scanner
scanner = BTHomeHub5DeviceScanner(config[DOMAIN])
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/bt_home_hub_5.py”, line 46, in init
data = bthomehub5_devicelist.get_devicelist(self.host)
File “/usr/local/lib/python3.6/site-packages/bthomehub5_devicelist/bthomehub5_devicelist.py”, line 20, in get_devicelist
return parse_devicelist(response.text)
File “/usr/local/lib/python3.6/site-packages/bthomehub5_devicelist/bthomehub5_devicelist.py”, line 31, in parse_devicelist
known_devices = p.tables[9]
IndexError: list index out of range

Cheers All
Al

Actually I get these errors when I use the device “Bt_Smarthub”

2019-02-10 13:32:25 ERROR (SyncWorker_0) [btsmarthub_devicelist.btsmarthub_devicelist] Invalid response from Smart Hub: <Response [404]>
2019-02-10 13:32:25 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform bt_smarthub
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/init.py”, line 176, in async_setup_platform
platform.get_scanner, hass, {DOMAIN: p_config})
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/bt_smarthub.py”, line 29, in get_scanner
scanner = BTSmartHubScanner(config[DOMAIN])
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/bt_smarthub.py”, line 45, in init
data = self.get_bt_smarthub_data()
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/bt_smarthub.py”, line 84, in get_bt_smarthub_data
router_ip=self.host, only_active_devices=True)
File “/usr/local/lib/python3.6/site-packages/btsmarthub_devicelist/btsmarthub_devicelist.py”, line 93, in get_devicelist
serverNonce = body[‘reply’][‘actions’][0][‘callbacks’][0][‘parameters’][‘nonce’]
UnboundLocalError: local variable ‘body’ referenced before assignment
2019-02-10 13:32:26 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 212, in async_update_ha_state
raise RuntimeError(“Attribute hass is None for {}”.format(self))
RuntimeError: Attribute hass is None for <Entity yr Symbol: 3>

Hey all, sorry I’ve taken so long to get back to this, life has been a bit crazy for me. I can hopefully have a look into these issues soon. It’s odd because I haven’t been having them, with my router at all. Watch this space for updates!

Hi all, so I’ve done my research I can confirm this component definitely works with a BT Home Hub 5 Type A. I have tested this on several of my friends hubs too and it works correctly.

The issues that people seem to be having looks to be due to the hub being a Type B. I cannot test this hypothesis however or fix the component so it works for a type B as i do not have access to one. If you are having issues, please check your Home Hub Type and report back. If you have a Type A and are still having issues, id be very interested to see your errors.

Many Thanks

Sorry to reopen such an old thread but I am just starting to explore HA. I have a BT Home Hub 6 aka BT Smart Hub - I can’t find anything which tells me whether it’s Type A or B or … just that the Firmware version is v0.09.06.05093-BT and it was last updated on Mon Jul 16 11:07:30 2018

I have the following entry in my config:

# Device Trackers
device_tracker:
  - platform: bt_smarthub
    host: 192.168.1.254
    interval_seconds: 5
    consider_home: 0:05
    new_device_defaults:
      track_new_devices: true
      hide_if_away: false

but when HA starts up I get the following lines in the log:

2019-09-09 12:20:16 ERROR (SyncWorker_2) [btsmarthub_devicelist.btsmarthub_devicelist] Invalid response from Smart Hub: <Response [404]>
2019-09-09 12:20:17 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform bt_smarthub
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/device_tracker/__init__.py", line 170, in async_setup_platform
    platform.get_scanner, hass, {DOMAIN: p_config})
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/bt_smarthub/device_tracker.py", line 22, in get_scanner
    scanner = BTSmartHubScanner(config[DOMAIN])
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/bt_smarthub/device_tracker.py", line 38, in __init__
    data = self.get_bt_smarthub_data()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/bt_smarthub/device_tracker.py", line 77, in get_bt_smarthub_data
    router_ip=self.host, only_active_devices=True)
  File "/usr/local/lib/python3.7/site-packages/btsmarthub_devicelist/btsmarthub_devicelist.py", line 93, in get_devicelist
    serverNonce = body['reply']['actions'][0]['callbacks'][0]['parameters']['nonce']
UnboundLocalError: local variable 'body' referenced before assignment

On the otherhand when I try to access
http://192.168.1.254/nonAuth/home_status.xml
as suggested by ha_novice in his original post I get a perfectly reasonable set of xml back.

Unfortunately running hass.io everything is nicely hidden away from prying eyes and I don’t yet know how to get at the source code to investigate further. Can anyone help?

Morning all

Just to confirm this does not work for my BT Home Hub 5 type B. I use the following lines in configuration.yaml:

  • platform: bt_home_hub_5
    host: x.x.x.x
    track_new_devices: true

and i get the following in the log:

2019-10-26 08:38:17 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy
Traceback (most recent call last):
File “/usr/src/app/homeassistant/components/device_tracker/setup.py”, line 69, in async_setup_legacy
self.platform.get_scanner, hass, {DOMAIN: self.config})
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/bt_home_hub_5/device_tracker.py”, line 22, in get_scanner
scanner = BTHomeHub5DeviceScanner(config[DOMAIN])
File “/usr/src/app/homeassistant/components/bt_home_hub_5/device_tracker.py”, line 39, in init
data = bthomehub5_devicelist.get_devicelist(self.host)
File “/usr/local/lib/python3.7/site-packages/bthomehub5_devicelist/bthomehub5_devicelist.py”, line 20, in get_devicelist
return parse_devicelist(response.text)
File “/usr/local/lib/python3.7/site-packages/bthomehub5_devicelist/bthomehub5_devicelist.py”, line 31, in parse_devicelist
known_devices = p.tables[9]
IndexError: list index out of range

I can see some XML with all my devices when loading the following:

http://x.x.x.x/nonAuth/home_status.xml

I hope this will get fixed.

I am looking to do IOS device tracking and have it working by NMAP at the moment, but i assume by using the router stats, it would be less draining on the battery of the devices than a constant network probe?

Cheers