Skip to content
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

adding device_tracker.tomato https params #4389

Merged
merged 8 commits into from
Jan 24, 2018
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 44 additions & 8 deletions source/_components/device_tracker.tomato.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,56 @@ To use this device tracker in your installation, add the following to your `conf
# Example configuration.yaml entry
device_tracker:
- platform: tomato
host: YOUR_ROUTER_IP_ADDRESS
host: YOUR_ROUTER_IP_ADDRESS_OR_HOSTNAME
port: YOUR_ROUTER_PORT
Copy link
Member

Choose a reason for hiding this comment

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

Optional configuration variables should not be in the examples.
We are trying to keep the examples as minimal as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be a good thing to call out that ^^ in the standards documentation since I don't think it mentions optional variables not being part of the examples.

ssl: True
ssl_verify: /mnt/NAS/router_cert.pem
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
http_id: YOUR_HTTP_ID
```

Configuration variables:

- **host** (*Required*): The IP address of your router, e.g. 192.168.1.1.
- **username** (*Required*: The username of an user with administrative privileges, usually *admin*.
- **password** (*Required*): The password for your given admin account.
- **http_id** (*Required*): The value can be obtained by logging in to the Tomato admin interface and search for `http_id` in the page source code.
{% configuration %}
host:
description: "The IP address or hostname of your router, e.g. `192.168.1.1` or `rt-ac68u`."
required: false
type: string
port:
description: "The port number of your router, e.g. `443`."
required: false
type: int
default: 80
ssl:
description: "Whether to connect via `https`."
required: false
type: bool
default: false
verify_ssl:
description: "If SSL verification for https resources needs to be turned off (for self-signed certs, etc.) this can take on boolean values `False` or `True` or you can pass a location on the device where a certificate can be used for verification e.g. `/mnt/NAS/router_cert.pem`."
required: false
type: [string, bool]
default: true
username:
description: "The username of an user with administrative privileges, usually *admin*."
required: true
type: string
password:
description: "The password for your given admin account."
required: true
type: string
http_id:
description: "The value can be obtained by logging in to the Tomato admin interface and search for `http_id` in the page source code."
required: true
type: string
{% endconfiguration %}

See the [device tracker component page](/components/device_tracker/) for instructions how to configure the people to be tracked.

A description of the API s available in this [Tomato API](http://paulusschoutsen.nl/blog/2013/10/tomato-api-documentation/) blog post.


SSL Certificate:

Gathering the SSL Certificate of your router can be accomplished with this (or a similar) command:
```bash
openssl s_client -showcerts -connect 172.10.10.1:443 </dev/null 2>/dev/null | openssl x509 -outform PEM > router_cert.pem
```