New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Traccar device tracker #18200

Merged
merged 5 commits into from Nov 5, 2018

Conversation

Projects
None yet
6 participants
@ludeeus
Member

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.

ludeeus added some commits Nov 4, 2018

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,

This comment has been minimized.

@fabaff

fabaff Nov 4, 2018

Member

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

This comment has been minimized.

@ludeeus

ludeeus Nov 4, 2018

Member

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

This comment has been minimized.

@ludeeus

ludeeus Nov 4, 2018

Member

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?

This comment has been minimized.

@amelchio

amelchio Nov 4, 2018

Member

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.

This comment has been minimized.

@ludeeus

ludeeus Nov 4, 2018

Member

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.

@amelchio

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

Show resolved Hide resolved homeassistant/components/device_tracker/traccar.py Outdated

ludeeus and others added some commits Nov 4, 2018

@pvizeli

pvizeli approved these changes Nov 5, 2018

@pvizeli pvizeli merged commit a901c59 into home-assistant:dev Nov 5, 2018

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA

@wafflebot wafflebot bot removed the in progress label Nov 5, 2018

@balloob balloob referenced this pull request Nov 29, 2018

Merged

0.83 #18776

@ludeeus ludeeus deleted the ludeeus:traccar branch Nov 29, 2018

@deanrparry

This comment has been minimized.

deanrparry commented Nov 29, 2018

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

This comment has been minimized.

Member

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.