pnbruckner / ha-composite-tracker

Home Assistant Composite Device Tracker
The Unlicense
120 stars 11 forks source link

Device position not set #52

Closed kalon33 closed 3 months ago

kalon33 commented 6 months ago

I have a device that appear in HA map but is not a device_tracker object (it is a sensor, sensor.trackit_child). Is has the following attributes:

Capture d’écran du 2023-12-20 15-42-45

How can I use it in ha-composite-tracker to be able to use it as a device_tracker ?

Currently I set up this:

composite:
  trackers:
    - name: Child
      time_as: device_or_local
      entity_id:
        - entity: device_tracker.composite_child
          use_picture: true
        - sensor.trackit_child

But position is still set as unknown.

Thanks for your help.

pnbruckner commented 6 months ago

Right now, the integration doesn't support a sensor like that. I'm planning a major upgrade of this integration in the relatively near future. I can consider having it accept a sensor like that.

Can I ask, what generates that sensor? Any idea why the attributes are lat & lng and not the standard latitude & longitude?

kalon33 commented 6 months ago

If you need some tests, I will be happy to help, as I'm pretty stuck with it right now.

Can I ask, what generates that sensor?

I'm using the TTN (The Things Network) integration to retrieve my LoRaWAN devices, and this one is a RAK Trackit device.

Any idea why the attributes are lat & lng and not the standard latitude & longitude?

My guess is that TTN values are decoded as variables with a given name and value, and that the plugin retrieves these without interpreting them. What is curious in my opinion is that while these are identified as a geographical position by HA which displays the device on the map, it is not usable as a device tracker.

pnbruckner commented 6 months ago

@kalon33 I've started working on the major update I referred to above. I'll see if I can work this in.

To that end, could you share the details of the sensor. E.g., go to the States page, click on the entity, and copy & paste what is shown. Or, better yet, go to the Templates page, and use something like:

{{ states.sensor.trackit_child.attributes }}

and share the output? Doing it this way provides more details about the actual Python types of the attributes.

pnbruckner commented 5 months ago

@kalon33 I could really use that additional information. I'm trying to add this right now and I need to know for sure the names of the attributes (not what they look like in the UI, which sometimes is different.)

If I don't hear back, I'll assume lat contains latitude, lon contains longitude & acc contains GPS accuracy in meters.

pnbruckner commented 3 months ago

@kalon33 I'm closing this since I haven't heard back from you, and because release 3.0.0 and later should support your use case.