GithubHelp home page GithubHelp logo

glance- / dhl Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 2.0 21 KB

A custom_component for home-assistant to track DHL packages via their api.

License: Apache License 2.0

Python 100.00%

dhl's Introduction

DHL custom_component

This is a custom component for home-assistant to track DHL packages.

Its activated by adding the following to your configuration.yaml:

sensor:
  - platform: dhl
    api_key: !secret dhl_api_key

And you get your own api key by registering at https://developer.dhl.com/

After that you can start to track your packages by calling the service dhl.register with a argument looking like {"package_id": "123456789"} to have home-assistant start tracking that package.

And when you loose interest in that package, you just stop tracking it by calling dhl.unregister with a corresponding argument.

To view all your packages in a nice fashion, I use the auto-entities[1] card to view them all as a list in lovelace:

      - card:
          type: entities
        filter:
          include:
            - domain: dhl
        type: 'custom:auto-entities'

This component shares quite a bit of code and architecture with my package tracker for Postnord[2], bring[3] and DbSchenker[4].

  1. https://github.com/thomasloven/lovelace-auto-entities
  2. https://github.com/glance-/postnord
  3. https://github.com/glance-/bring
  4. https://github.com/glance-/dbschenker

dhl's People

Contributors

glance- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dhl's Issues

homeassitant warning - deprecation for async_add_job

2024-04-24 11:50:49.821 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'dhl' calls async_add_job, which is deprecated and will be removed in Home Assistant 2025.4; Please review https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job for replacement options at custom_components/dhl/sensor.py, line 86: await hass.async_add_job(save_json, json_path, registrations), please report it to the author of the 'dhl' custom integration

I hereby reported this :)

Package Title / Name

this is not really a issue.

Is it somehow possible to add a package title or anything to a specific package?
If you track multiple packages, its hard to know which is which.

Entities wont update

Thanks for your work here, it works mostly very good.

The problem is refreshing the entities to get their new states. Is there a way to control the polling or just trigger a refresh without doing unregister and register again?

Cant unregister

Ive tested a bit and created some weird tracking ids.

Ive registered IDs like "dhl" "dhl123" "123dhl"

So creating this is not a problem, but i cant unregister them. So now theyre in my entity list and cant get removed or unregistered.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.