Skip to content

Add Traccar device tracker#18200

Merged
pvizeli merged 5 commits intohome-assistant:devfrom
ludeeus:traccar
Nov 5, 2018
Merged

Add Traccar device tracker#18200
pvizeli merged 5 commits intohome-assistant:devfrom
ludeeus:traccar

Conversation

@ludeeus
Copy link
Copy Markdown
Member

@ludeeus ludeeus commented Nov 4, 2018

Description:

Adds traccar as a new GPS device tracker.

This platform has support for over 1500 different types of devices.

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7364

Example entry for configuration.yaml (if applicable):

device_tracker:
  platform: traccar
  host: 192.168.1.113
  username: admin
  password: password

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_HOST): cv.string,
vol.Optional(CONF_PORT, default=8082): cv.port,
vol.Optional(CONF_SSL, default=False): cv.boolean,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest that we are using a secured channel for the communication by default, if possible.

Copy link
Copy Markdown
Member Author

@ludeeus ludeeus Nov 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible, but I think that would confuse the potential enduser?
Home Assistant itself and most of the components/platforms do have this as false by defaul?

git grep "CONF_SSL, default=True"
homeassistant/components/sensor/synologydsm.py:    vol.Optional(CONF_SSL, default=True): cv.boolean,
git grep "CONF_SSL, default=False"
homeassistant/components/binary_sensor/hikvision.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/device_tracker/netgear.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/device_tracker/tomato.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/device_tracker/traccar.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/media_player/epson.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/octoprint.py:        vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/sensor/nzbget.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/sensor/pyload.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/sensor/qnap.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/sensor/radarr.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/sensor/sma.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/sensor/sonarr.py:    vol.Optional(CONF_SSL, default=False): cv.boolean,
homeassistant/components/splunk.py:        vol.Optional(CONF_SSL, default=False): cv.boolean,
git grep "DEFAULT_SSL ="
homeassistant/components/binary_sensor/concord232.py:DEFAULT_SSL = False
homeassistant/components/binary_sensor/nx584.py:DEFAULT_SSL = False
homeassistant/components/climate/venstar.py:DEFAULT_SSL = False
homeassistant/components/device_tracker/ddwrt.py:DEFAULT_SSL = False
homeassistant/components/device_tracker/luci.py:DEFAULT_SSL = False
homeassistant/components/media_player/emby.py:DEFAULT_SSL = False
homeassistant/components/media_player/firetv.py:DEFAULT_SSL = False
homeassistant/components/media_player/itunes.py:DEFAULT_SSL = False
homeassistant/components/rainmachine/__init__.py:DEFAULT_SSL = True
homeassistant/components/sabnzbd.py:DEFAULT_SSL = False
homeassistant/components/sensor/influxdb.py:DEFAULT_SSL = False
homeassistant/components/sensor/mfi.py:DEFAULT_SSL = True
homeassistant/components/sensor/pi_hole.py:DEFAULT_SSL = False
homeassistant/components/sensor/plex.py:DEFAULT_SSL = False
homeassistant/components/sensor/tautulli.py:DEFAULT_SSL = False
homeassistant/components/splunk.py:DEFAULT_SSL = False
homeassistant/components/switch/mfi.py:DEFAULT_SSL = True
homeassistant/components/zabbix.py:DEFAULT_SSL = False
homeassistant/components/zoneminder/__init__.py:DEFAULT_SSL = False

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not disagree with the suggestion, but to my knowledge, there is not a standard that a component or a platform should have that enabled by default, it may be something to discuss in https://github.com/home-assistant/architecture?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes a difference where the target is located. Devices on the LAN usually do not have valid certificates anyway.

Connections to servers on the internet should default to SSL with verification.

Copy link
Copy Markdown
Member Author

@ludeeus ludeeus Nov 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if their paid service is running SSL, but the demo versions are not.
For the local version they do not have built-in support for SSL, you would have to run it behind a proxy to get that for a local instance.
I have used a local instance (hassio add-on) while building and testing this.

Copy link
Copy Markdown
Contributor

@amelchio amelchio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me but I am no device_tracker wizard.

@ghost ghost assigned pvizeli Nov 5, 2018
@pvizeli pvizeli merged commit a901c59 into home-assistant:dev Nov 5, 2018
@ghost ghost removed the in progress label Nov 5, 2018
@balloob balloob mentioned this pull request Nov 29, 2018
@ludeeus ludeeus deleted the traccar branch November 29, 2018 17:00
@deanrparry
Copy link
Copy Markdown

very nice indeed :) was using a custom component before which i tweaked with battery etc... any chances that monitored conditions could be added to this to allow additional fields? factoring in if two devices have different fields available etc... then sir you will be a god lol

@ludeeus
Copy link
Copy Markdown
Member Author

ludeeus commented Nov 29, 2018

Please open an issue if you suspect a bug. If you need help please use our help channels:
https://home-assistant.io/help/#communication-channels
Feature requests can be opened on the Forum.

Merged PRs should not be used for support or bug reports. Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Nov 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants