Better looking device tracker

I am getting errors with this component. Is it still working for anyone else ins 84.1?

Error loading custom_components.binary_sensor.device_tracker_sensor. Make sure all dependencies are installed

Yes, I got the same error message. The original custom component code contains an import statement that is not actually required.

To fix this, find file device_tracker_sensor.py in your custom_components folder, and remove (or comment out) the following line:

from homeassistant.helpers.restore_state import async_get_last_state
4 Likes

thanks for the tip! just made my config useable again :slight_smile:

as the original (from the first post) url gives me 404 - is there any place on github where this component is being kept and developed? my search failed, and just thought that it would be nice to have ā€œthe original sourceā€ on the web just in case.

It is here: https://github.com/abmantis/homeassistant-custom-components/tree/master/others/binary_sensor
Iā€™ve not updated it to 0.84 yet.

2 Likes

great, thanks!

Thank you for sharing the fix. Much appreciated

You really should submit a PR for this. It is a GREAT component.

It wonā€™t be accepted since this can already be done with templates (in a more tedious way, but still).

I use templates in my setup to accomplish what this custom component does (found my way here while exploring Home Assistant configs on github). Itā€™s really about the same amount of effort, since you list the device trackers for either one? Sure thereā€™s some extra values set for the template, but itā€™s mostly copy paste between them (I have one set up for each of my cameras).

Using binary_sensor template platform:

- platform: template
  sensors:
    int_dome_01:
      device_class: connectivity
      entity_id: device_tracker.camera_interior_01
      friendly_name: Int Cam 01
      value_template: "{{ is_state('device_tracker.camera_interior_01', 'home') }}"
      icon_template: mdi:cctv

Hi,

iā€™ve get this error on check configuration on home assistant 0.92.0:

General Errors:

  • Integration device_tracker_sensor not found when trying to verify its binary_sensor platform.

Iā€™ve get this error with add-on check configuration. How resolve this?

I am also getting the same error after updating just now to 0.92.0 from 0.91.4

Maybe this is the fix ? Will try later.

Iā€™ve added the missing file for this custom_component to the github repo. Please download the component with the new folder structure.

1 Like

To help others I downloaded the whole file from here it is under ā€œhomeassistant-custom-components/others/device_tracker_sensor/ā€

I copied both the new init file and binary_sensors.py file over but the built in checker kept running and running but was ok via CLI (this could be just related to my HA instance). I restarted HA from CLI ā€œcore-ssh:~# hassio ha restartā€ and all seems to be working as usual :grinning:

Since the restart the built in checker now runs fine - weird :open_mouth:

Hi abmantis,

iā€™m using your great component for a long time but now with the new version 0.110 it doesnā€™t work anymore.

Logger: homeassistant.components.binary_sensor
Source: components/binary_sensor/__init__.py:174
Integration: BinƤrsensor ([documentation](https://www.home-assistant.io/integrations/binary_sensor)
First occurred: 25. Mai 2020, 19:39:17 (1 occurrences)
Last logged: 25. Mai 2020, 19:39:17
BinarySensorDevice is deprecated, modify DeviceTrackerSensor to extend BinarySensorEntity

do you still maintain this competent?

Greetings,
El Grande

Hey,
I was hopping someone could submit a PR to fix it, I donā€™t think the change is too hard but I havenā€™t been able to find the time to do it.

So this aint working anymore for me as of 0.118.0. But the results can still be obtained by creating regular binary_sensors.

platform: template
sensors:
  device_tracker_devicename_a:
      entity_id:
        - device_tracker.devicename_a
      value_template: '{% if states.device_tracker.devicename_a %}
          {% if states.device_tracker.devicename_a.state == "home" %}
            On
          {% else %}
            Off
          {% endif %}
          {% else %}
          n/a
          {% endif %}'
  device_tracker_devicename_b:
      entity_id:
        - device_tracker.devicename_b
      value_template: '{% if states.device_tracker.devicename_b %}
          {% if states.device_tracker.devicename_b.state == "home" %}
            On
          {% else %}
            Off
          {% endif %}
          {% else %}
          n/a
          {% endif %}'

This will return On / Off / n/a depending if state is home/away/unresolvable.

Will also have to specify binary_sensor data in customization.

binary_sensor.device_tracker_devicename_a:
  icon: mdi:icon-for-device-a
  friendly_name: Device A
binary_sensor.device_tracker_devicename_b:
  icon: mdi:icon-for-device-b
  friendly_name: Device B