mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-09 02:16:50 +00:00
Merge branch 'current' into next
This commit is contained in:
commit
cb98ebb5f0
@ -47,6 +47,8 @@ It's recommended to set `scan_interval:` according to a value greater than 60 se
|
|||||||
|
|
||||||
To format the PVoutput sensor it's recommended to use the [template component](/topics/templating/). For example:
|
To format the PVoutput sensor it's recommended to use the [template component](/topics/templating/). For example:
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sensor:
|
sensor:
|
||||||
- platform: pvoutput
|
- platform: pvoutput
|
||||||
@ -56,19 +58,21 @@ sensor:
|
|||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
power_consumption:
|
power_consumption:
|
||||||
value_template: {% raw %}'{% if is_state_attr("sensor.pvoutput", "power_consumption", "NaN") %}0{% else %}{{ state_attr('sensor.pvoutput', 'power_consumption') }}{% endif %}'{% endraw %}
|
value_template: '{% if is_state_attr("sensor.pvoutput", "power_consumption", "NaN") %}0{% else %}{{ state_attr("sensor.pvoutput", "power_consumption") }}{% endif %}'
|
||||||
friendly_name: 'Using'
|
friendly_name: 'Using'
|
||||||
unit_of_measurement: 'Watt'
|
unit_of_measurement: 'Watt'
|
||||||
energy_consumption:
|
energy_consumption:
|
||||||
value_template: {% raw %}'{{ "%0.1f"|format(state_attr('sensor.pvoutput', 'energy_consumption')|float/1000) }}'{% endraw %}
|
value_template: '{{ "%0.1f"|format(state_attr("sensor.pvoutput", "energy_consumption")|float/1000) }}'
|
||||||
friendly_name: 'Used'
|
friendly_name: 'Used'
|
||||||
unit_of_measurement: 'kWh'
|
unit_of_measurement: 'kWh'
|
||||||
power_generation:
|
power_generation:
|
||||||
value_template: {% raw %}'{% if is_state_attr("sensor.pvoutput", "power_generation", "NaN") %}0{% else %}{{ state_attr('sensor.pvoutput', 'power_generation') }}{% endif %}'{% endraw %}
|
value_template: '{% if is_state_attr("sensor.pvoutput", "power_generation", "NaN") %}0{% else %}{{ state_attr("sensor.pvoutput", "power_generation") }}{% endif %}'
|
||||||
friendly_name: 'Generating'
|
friendly_name: 'Generating'
|
||||||
unit_of_measurement: 'Watt'
|
unit_of_measurement: 'Watt'
|
||||||
energy_generation:
|
energy_generation:
|
||||||
value_template: {% raw %}'{% if is_state_attr("sensor.pvoutput", "energy_generation", "NaN") %}0{% else %}{{ "%0.2f"|format(state_attr('sensor.pvoutput', 'energy_generation')|float/1000) }}{% endif %}'{% endraw %}
|
value_template: '{% if is_state_attr("sensor.pvoutput", "energy_generation", "NaN") %}0{% else %}{{ "%0.2f"|format(state_attr("sensor.pvoutput", "energy_generation")|float/1000) }}{% endif %}'
|
||||||
friendly_name: 'Generated'
|
friendly_name: 'Generated'
|
||||||
unit_of_measurement: 'kWh'
|
unit_of_measurement: 'kWh'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{% endraw %}
|
||||||
|
@ -15,30 +15,21 @@ The `vizio` integration allows you to control [SmartCast](https://www.vizio.com/
|
|||||||
|
|
||||||
## Find your device
|
## Find your device
|
||||||
|
|
||||||
Install the command line tool using `pip` (or download it manually):
|
### Install pyvizio locally
|
||||||
|
|
||||||
```bash
|
> NOTE: If the `pip3` command is not found, try `pip` instead
|
||||||
$ pip3 install pyvizio
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
- To install, run `pip3 install pyvizio` in your terminal.
|
||||||
|
- If `pyvizio` is already installed locally, make sure you are using the latest version by running `pip3 install --upgrade pyvizio` in your terminal.
|
||||||
|
|
||||||
```bash
|
### Discover devices
|
||||||
$ pip3 install git+https://github.com/vkorn/pyvizio.git@master
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ pip3 install -I .
|
|
||||||
```
|
|
||||||
|
|
||||||
Find your device using the following command:
|
Find your device using the following command:
|
||||||
```txt
|
```bash
|
||||||
pyvizio --ip=0 discover
|
$ pyvizio --ip=0 discover
|
||||||
```
|
```
|
||||||
|
|
||||||
and note its IP address. If using the IP address by itself does not work, you may need to append `:9000` or `:7345` to it when using it as a parameter in future commands.
|
and note its IP address and port number. If you have trouble finding a device you were expecting to, you can try increasing the discovery timeout period by adding the `--timeout` option (e.g. `pyvizio --ip=0 discover --timeout=10`).
|
||||||
|
|
||||||
## Pairing
|
## Pairing
|
||||||
|
|
||||||
@ -48,28 +39,28 @@ To obtain an auth token, follow these steps:
|
|||||||
|
|
||||||
Make sure that your device is on before continuing.
|
Make sure that your device is on before continuing.
|
||||||
|
|
||||||
| Parameter | Description |
|
| Parameter | Description |
|
||||||
|:----------------|:---------------------|
|
| :------------ | :---------------------------------------------------------------------- |
|
||||||
| `ip` | IP address (possibly including port) obtained from the previous section |
|
| `ip` | `IP Address:Port` (obtained from the previous section) |
|
||||||
| `device_type` | The type of device you are connecting to. Options are `tv` or `speaker` |
|
| `device_type` | The type of device you are connecting to. Options are `tv` or `speaker` |
|
||||||
|
|
||||||
Enter the following command to initiate pairing:
|
Enter the following command to initiate pairing:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ pyvizio --ip={ip} --device_type={device_type} pair
|
$ pyvizio --ip={ip:port} --device_type={device_type} pair
|
||||||
```
|
```
|
||||||
|
|
||||||
Initiation will show you two different values:
|
Initiation will show you two different values:
|
||||||
|
|
||||||
| Value | Description |
|
| Value | Description |
|
||||||
|:----------------|:---------------------|
|
| :-------------- | :------------------------------------------------------------------------------------------------------ |
|
||||||
| Challenge type | Usually it should be `"1"`. If not, use the additional parameter `--ch_type=your_type` in the next step |
|
| Challenge type | Usually it should be `"1"`. If not, use the additional parameter `--ch_type=your_type` in the next step |
|
||||||
| Challenge token | Token required to finalize pairing in the next step |
|
| Challenge token | Token required to finalize pairing in the next step |
|
||||||
|
|
||||||
At this point, a PIN code should be displayed at the top of your TV. With all these values, you can now finish pairing:
|
At this point, a PIN code should be displayed at the top of your TV. With all these values, you can now finish pairing:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ pyvizio --ip={ip} --device_type={device_type} pair-finish --token={challenge_token} --pin={pin}
|
$ pyvizio --ip={ip:port} --device_type={device_type} pair-finish --token={challenge_token} --pin={pin}
|
||||||
```
|
```
|
||||||
|
|
||||||
You will need the authentication token returned by this command to configure Home Assistant.
|
You will need the authentication token returned by this command to configure Home Assistant.
|
||||||
@ -81,13 +72,13 @@ To add your Vizio TV to your installation, add the following to your `configurat
|
|||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
vizio:
|
vizio:
|
||||||
- host: IP_ADDRESS
|
- host: "DEVICE_IP:DEVICE_PORT"
|
||||||
access_token: AUTH_TOKEN
|
access_token: AUTH_TOKEN
|
||||||
```
|
```
|
||||||
|
|
||||||
{% configuration %}
|
{% configuration %}
|
||||||
host:
|
host:
|
||||||
description: IP address of your device.
|
description: "`IP Address:Port` for your device (port is optional but recommended)."
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
|
@ -30,6 +30,11 @@ name:
|
|||||||
description: Overwrites friendly name.
|
description: Overwrites friendly name.
|
||||||
type: string
|
type: string
|
||||||
default: Name of Entity
|
default: Name of Entity
|
||||||
|
icon:
|
||||||
|
required: false
|
||||||
|
description: Overwrites icon.
|
||||||
|
type: string
|
||||||
|
default: Entity Domain Icon
|
||||||
theme:
|
theme:
|
||||||
required: false
|
required: false
|
||||||
description: Set to any theme within `themes.yaml`.
|
description: Set to any theme within `themes.yaml`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user