Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kodi1/tracker_merge
merge master/slave device trackers
https://github.com/kodi1/tracker_merge
hacs home-assistant python python-script tracking
Last synced: 7 days ago
JSON representation
merge master/slave device trackers
- Host: GitHub
- URL: https://github.com/kodi1/tracker_merge
- Owner: kodi1
- Created: 2020-01-10T17:06:31.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-21T19:05:19.000Z (over 3 years ago)
- Last Synced: 2024-08-01T15:34:58.998Z (3 months ago)
- Topics: hacs, home-assistant, python, python-script, tracking
- Language: Python
- Homepage:
- Size: 172 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tracker_merge
Merge master/slave device trackers and generate mabox view for them.
## Example configuration.yaml
```yaml
automation:
- alias: track_merge
initial_state: off
trigger:
- platform: state
entity_id: device_tracker.xxx
- platform: state
entity_id: device_tracker.google_maps_xxx
action:
- service: python_script.device_tracker_merge
data_template:
device_name: 'new_device'
master_device: device_tracker.xxx
slave_device: device_tracker.google_maps_xxx
trigger_id: '{{trigger.entity_id}}'
time: 10
force_update: 10
accuracy: 1000
distance: "{{ distance(states.device_tracker.xxx, states.device_tracker.google_maps_xxx) }}"camera:
name: tracker
platform: generic
still_image_url: >-
{%- set pitch = state_attr('sensor.view_new_device', 'pitch') -%}
{%- set c_longitude = state_attr('sensor.view_new_device', 'c_longitude') -%}
{%- set c_latitude = state_attr('sensor.view_new_device', 'c_latitude') -%}
{%- set o_longitude = state_attr('sensor.view_new_device', 'o_longitude') -%}
{%- set o_latitude = state_attr('sensor.view_new_device', 'o_latitude') -%}
{%- set m_longitude = state_attr('sensor.view_new_device', 'm_longitude') -%}
{%- set m_latitude = state_attr('sensor.view_new_device', 'm_latitude') -%}
{%- set pitch = state_attr('sensor.view_new_device', 'pitch') -%}
{%- set zoom = state_attr('sensor.view_new_device', 'zoom') -%}
{%- set bearing = state_attr('sensor.view_new_device', 'bearing') -%}
{%- set key = states('sensor.mapbox_key') -%}
{%- if zoom == 'auto' -%}
https://api.mapbox.com/styles/v1/mapbox/outdoors-v10/static/pin-s-o+2ecc71({{o_longitude}},{{o_latitude}}),pin-s-c+3498db({{c_longitude}},{{c_latitude}})/auto/400x400?access_token={{key}}
{%- else -%}
https://api.mapbox.com/styles/v1/mapbox/outdoors-v10/static/pin-s-o+2ecc71({{o_longitude}},{{o_latitude}}),pin-s-c+3498db({{c_longitude}},{{c_latitude}})/{{m_longitude}},{{m_latitude}},{{zoom}},{{bearing}},{{pitch}}/400x400?access_token={{key}}
{%- endif -%}
limit_refetch_to_url_change: true
```
![Screenshot](https://github.com/kodi1/tracker_merge/blob/master/images/tracker_view.png?raw=true)[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/custom-components/hacs)