Fix formatting issue during resolving merges

This commit is contained in:
Franck Nijhof 2023-06-07 11:43:01 +02:00
parent c27c90813e
commit 41420845cd
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 229 additions and 280 deletions

View File

@ -18,7 +18,7 @@ ha_platforms:
- switch - switch
ha_integration_type: integration ha_integration_type: integration
ha_codeowners: ha_codeowners:
- "@gjohansson-ST" - '@gjohansson-ST'
--- ---
The `command_line` offers functionality that issues specific commands to get data or to control a device. The `command_line` offers functionality that issues specific commands to get data or to control a device.
@ -31,203 +31,203 @@ It's highly recommended to enclose the command in single quotes `'` as it ensure
{% configuration %} {% configuration %}
command_line: command_line:
description: The platforms to use for you command_line integration. description: The platforms to use for you command_line integration.
required: true required: true
type: list type: list
keys: keys:
binary_sensor: binary_sensor:
description: Binary sensor platform. description: Binary sensor platform.
required: false required: false
type: map type: map
keys: keys:
command: command:
description: The action to take to get the value. description: The action to take to get the value.
required: true required: true
type: string type: string
command_timeout: command_timeout:
description: Defines number of seconds for command timeout. description: Defines number of seconds for command timeout.
required: false required: false
type: integer type: integer
default: 15 default: 15
device_class: device_class:
description: Sets the [class of the device](/integrations/binary_sensor/), changing the device state and icon that is displayed on the frontend. description: Sets the [class of the device](/integrations/binary_sensor/), changing the device state and icon that is displayed on the frontend.
required: false required: false
type: string type: string
name: name:
description: Let you overwrite the name of the device. description: Let you overwrite the name of the device.
required: false required: false
type: string type: string
default: "_name_ from the device" default: "*name* from the device"
payload_on: payload_on:
description: The payload that represents enabled state. description: The payload that represents enabled state.
required: false required: false
type: string type: string
default: 'ON' default: 'ON'
unique_id: unique_id:
description: An ID that uniquely identifies this binary sensor. Set this to a unique value to allow customization through the UI. description: An ID that uniquely identifies this binary sensor. Set this to a unique value to allow customization through the UI.
required: false required: false
type: string type: string
payload_off: payload_off:
description: The payload that represents disabled state. description: The payload that represents disabled state.
required: false required: false
type: string type: string
default: 'OFF' default: 'OFF'
value_template: value_template:
description: Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload. description: Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
required: false required: false
type: string type: string
scan_interval: scan_interval:
description: Define time in seconds between each update. description: Define time in seconds between each update.
required: false required: false
type: integer type: integer
default: 60 default: 60
cover: cover:
description: Cover platform. description: Cover platform.
required: false required: false
type: map type: map
keys: keys:
command_close: command_close:
description: The action to close the cover. description: The action to close the cover.
required: true required: true
default: true default: true
type: string type: string
command_open: command_open:
description: The command to open the cover. description: The command to open the cover.
required: true required: true
default: true default: true
type: string type: string
command_state: command_state:
description: If given, this will act as a sensor that runs in the background and updates the state of the cover. If the command returns a `0` the indicates the cover is fully closed, whereas a 100 indicates the cover is fully open. description: If given, this will act as a sensor that runs in the background and updates the state of the cover. If the command returns a `0` the indicates the cover is fully closed, whereas a 100 indicates the cover is fully open.
required: false required: false
type: string type: string
command_stop: command_stop:
description: The action to stop the cover. description: The action to stop the cover.
required: true required: true
default: true default: true
type: string type: string
command_timeout: command_timeout:
description: Defines number of seconds for command timeout. description: Defines number of seconds for command timeout.
required: false required: false
type: integer type: integer
default: 15 default: 15
name: name:
description: The name used to display the cover in the frontend. description: The name used to display the cover in the frontend.
required: true required: true
type: string type: string
unique_id: unique_id:
description: An ID that uniquely identifies this cover. Set this to a unique value to allow customization through the UI. description: An ID that uniquely identifies this cover. Set this to a unique value to allow customization through the UI.
required: false required: false
type: string type: string
value_template: value_template:
description: if specified, `command_state` will ignore the result code of the command but the template evaluating will indicate the position of the cover. For example, if your `command_state` returns a string "open", using `value_template` as in the example configuration above will allow you to translate that into the valid state `100`. description: if specified, `command_state` will ignore the result code of the command but the template evaluating will indicate the position of the cover. For example, if your `command_state` returns a string "open", using `value_template` as in the example configuration above will allow you to translate that into the valid state `100`.
required: false required: false
type: template type: template
scan_interval: scan_interval:
description: Define time in seconds between each update. description: Define time in seconds between each update.
required: false required: false
type: integer type: integer
default: 15 default: 15
notify: notify:
description: Notify platform. description: Notify platform.
required: false required: false
type: map type: map
keys: keys:
name: name:
description: Setting the optional parameter `name` allows multiple notifiers to be created. The notifier will bind to the service `notify.NOTIFIER_NAME`. description: Setting the optional parameter `name` allows multiple notifiers to be created. The notifier will bind to the service `notify.NOTIFIER_NAME`.
required: false required: false
default: notify default: notify
type: string type: string
command: command:
description: The action to take. description: The action to take.
required: true required: true
type: string type: string
command_timeout: command_timeout:
description: Defines number of seconds for command timeout. description: Defines number of seconds for command timeout.
required: false required: false
type: integer type: integer
default: 15 default: 15
sensor: sensor:
description: Sensor platform. description: Sensor platform.
required: false required: false
type: map type: map
keys: keys:
command: command:
description: The action to take to get the value. description: The action to take to get the value.
required: true required: true
type: string type: string
command_timeout: command_timeout:
description: Defines number of seconds for command timeout description: Defines number of seconds for command timeout
required: false required: false
type: integer type: integer
default: 15 default: 15
json_attributes: json_attributes:
description: Defines a list of keys to extract values from a JSON dictionary result and then set as sensor attributes. description: Defines a list of keys to extract values from a JSON dictionary result and then set as sensor attributes.
required: false required: false
type: [string, list] type: [string, list]
name: name:
description: Name of the command sensor. description: Name of the command sensor.
required: false required: false
type: string type: string
unique_id: unique_id:
description: An ID that uniquely identifies this sensor. Set this to a unique value to allow customization through the UI. description: An ID that uniquely identifies this sensor. Set this to a unique value to allow customization through the UI.
required: false required: false
type: string type: string
unit_of_measurement: unit_of_measurement:
description: Defines the unit of measurement of the sensor, if any. description: Defines the unit of measurement of the sensor, if any.
required: false required: false
type: string type: string
value_template: value_template:
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload." description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload."
required: false required: false
type: string type: string
scan_interval: scan_interval:
description: Define time in seconds between each update. description: Define time in seconds between each update.
required: false required: false
type: integer type: integer
default: 60 default: 60
switch: switch:
description: Switch platform. description: Switch platform.
required: false required: false
type: map type: map
keys: keys:
command_on: command_on:
description: The action to take for on. description: The action to take for on.
required: true required: true
type: string type: string
command_off: command_off:
description: The action to take for off. description: The action to take for off.
required: true required: true
type: string type: string
command_state: command_state:
description: "If given, this command will be run. Returning a result code `0` will indicate that the switch is on." description: "If given, this command will be run. Returning a result code `0` will indicate that the switch is on."
required: false required: false
type: string type: string
command_timeout: command_timeout:
description: Defines number of seconds for command timeout. description: Defines number of seconds for command timeout.
required: false required: false
type: integer type: integer
default: 15 default: 15
name: name:
description: The name used to display the switch in the frontend. description: The name used to display the switch in the frontend.
required: true required: true
type: string type: string
icon_template: icon_template:
description: Defines a template for the icon of the entity. description: Defines a template for the icon of the entity.
required: false required: false
type: template type: template
unique_id: unique_id:
description: An ID that uniquely identifies this switch. Set this to a unique value to allow customization through the UI. description: An ID that uniquely identifies this switch. Set this to a unique value to allow customization through the UI.
required: false required: false
type: string type: string
value_template: value_template:
description: "If specified, `command_state` will ignore the result code of the command but the template evaluating to `true` will indicate the switch is on." description: "If specified, `command_state` will ignore the result code of the command but the template evaluating to `true` will indicate the switch is on."
required: false required: false
type: string type: string
scan_interval: scan_interval:
description: Define time in seconds between each update. description: Define time in seconds between each update.
required: false required: false
type: integer type: integer
default: 30 default: 30
{% endconfiguration %} {% endconfiguration %}
## Binary sensor ## Binary sensor
@ -235,14 +235,12 @@ default: 30
To use your Command binary sensor in your installation, add the following to your `configuration.yaml` file: To use your Command binary sensor in your installation, add the following to your `configuration.yaml` file:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
- binary_sensor: - binary_sensor:
command: "cat /proc/sys/net/ipv4/ip_forward" command: "cat /proc/sys/net/ipv4/ip_forward"
``` ```
{% endraw%} {% endraw%}
## Cover ## Cover
@ -252,7 +250,6 @@ A `command_line`cover platform that issues specific commands when it is moved up
To enable a command line cover in your installation, add the following to your `configuration.yaml` file: To enable a command line cover in your installation, add the following to your `configuration.yaml` file:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -262,7 +259,6 @@ command_line:
command_stop: move_command stop garage command_stop: move_command stop garage
name: Garage name: Garage
``` ```
{% endraw%} {% endraw%}
## Notify ## Notify
@ -272,14 +268,12 @@ The `command_line` platform allows you to use external tools for notifications f
To enable those notifications in your installation, add the following to your `configuration.yaml` file: To enable those notifications in your installation, add the following to your `configuration.yaml` file:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
- notify: - notify:
command: "espeak -vmb/mb-us1" command: "espeak -vmb/mb-us1"
``` ```
{% endraw%} {% endraw%}
To use notifications, please see the [getting started with automation page](/getting-started/automation/). To use notifications, please see the [getting started with automation page](/getting-started/automation/).
@ -289,14 +283,12 @@ To use notifications, please see the [getting started with automation page](/get
To enable it, add the following lines to your `configuration.yaml`: To enable it, add the following lines to your `configuration.yaml`:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
- sensor: - sensor:
command: SENSOR_COMMAND command: SENSOR_COMMAND
``` ```
{% endraw%} {% endraw%}
## Switch ## Switch
@ -309,7 +301,6 @@ controlled from the command line, including calling other scripts!
To enable it, add the following lines to your `configuration.yaml`: To enable it, add the following lines to your `configuration.yaml`:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -318,7 +309,6 @@ command_line:
command_on: switch_command on kitchen command_on: switch_command on kitchen
command_off: switch_command off kitchen command_off: switch_command off kitchen
``` ```
{% endraw%} {% endraw%}
<div class='note'> <div class='note'>
@ -352,7 +342,6 @@ In this section you find some real-life examples of how to use the command_line
Check the state of an [SickRage](https://github.com/sickragetv/sickrage) instance. Check the state of an [SickRage](https://github.com/sickragetv/sickrage) instance.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -363,7 +352,6 @@ command_line:
payload_on: "Running" payload_on: "Running"
payload_off: "Not running" payload_off: "Not running"
``` ```
{% endraw%} {% endraw%}
### Check RasPlex ### Check RasPlex
@ -371,7 +359,6 @@ command_line:
Check if [RasPlex](https://github.com/RasPlex/RasPlex) is `online`. Check if [RasPlex](https://github.com/RasPlex/RasPlex) is `online`.
{% raw %} {% raw %}
```yaml ```yaml
command_line: command_line:
- binary_sensor: - binary_sensor:
@ -381,23 +368,20 @@ command_line:
payload_on: 1 payload_on: 1
payload_off: 0 payload_off: 0
``` ```
{% endraw%} {% endraw%}
An alternative solution could look like this: An alternative solution could look like this:
{% raw %} {% raw %}
```yaml ```yaml
command_line: command_line:
- binary_sensor: - binary_sensor:
name: Printer name: Printer
command: "ping -W 1 -c 1 192.168.1.10 > /dev/null 2>&1 && echo success || echo fail" command: 'ping -W 1 -c 1 192.168.1.10 > /dev/null 2>&1 && echo success || echo fail'
device_class: connectivity device_class: connectivity
payload_on: "success" payload_on: "success"
payload_off: "fail" payload_off: "fail"
``` ```
{% endraw%} {% endraw%}
Consider to use the [ping sensor](/integrations/ping#binary-sensor) as an alternative to the samples above. Consider to use the [ping sensor](/integrations/ping#binary-sensor) as an alternative to the samples above.
@ -407,7 +391,6 @@ Consider to use the [ping sensor](/integrations/ping#binary-sensor) as an altern
The services running is listed in `/etc/systemd/system` and can be checked with the `systemctl` command: The services running is listed in `/etc/systemd/system` and can be checked with the `systemctl` command:
{% raw %} {% raw %}
```bash ```bash
$ systemctl is-active home-assistant@rock64.service $ systemctl is-active home-assistant@rock64.service
active active
@ -415,27 +398,23 @@ $ sudo service home-assistant@rock64.service stop
$ systemctl is-active home-assistant@rock64.service $ systemctl is-active home-assistant@rock64.service
inactive inactive
``` ```
{% endraw%} {% endraw%}
A binary command line sensor can check this: A binary command line sensor can check this:
{% raw %} {% raw %}
```yaml ```yaml
command_line: command_line:
- binary_sensor: - binary_sensor:
command: "/bin/systemctl is-active home-assistant@rock64.service" command: '/bin/systemctl is-active home-assistant@rock64.service'
payload_on: "active" payload_on: "active"
payload_off: "inactive" payload_off: "inactive"
``` ```
{% endraw%} {% endraw%}
## Example cover platform ## Example cover platform
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -452,7 +431,6 @@ command_line:
0 0
{% endif %} {% endif %}
``` ```
{% endraw%} {% endraw%}
## Examples sensor platform ## Examples sensor platform
@ -464,7 +442,6 @@ In this section you find some real-life examples of how to use this sensor.
Thanks to the [`proc`](https://en.wikipedia.org/wiki/Procfs) file system, various details about a system can be retrieved. Here the CPU temperature is of interest. Add something similar to your `configuration.yaml` file: Thanks to the [`proc`](https://en.wikipedia.org/wiki/Procfs) file system, various details about a system can be retrieved. Here the CPU temperature is of interest. Add something similar to your `configuration.yaml` file:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -475,7 +452,6 @@ command_line:
unit_of_measurement: "°C" unit_of_measurement: "°C"
value_template: "{{ value | multiply(0.001) | round(1) }}" value_template: "{{ value | multiply(0.001) | round(1) }}"
``` ```
{% endraw%} {% endraw%}
### Monitoring failed login attempts on Home Assistant ### Monitoring failed login attempts on Home Assistant
@ -483,7 +459,6 @@ command_line:
If you'd like to know how many failed login attempts are made to Home Assistant, add the following to your `configuration.yaml` file: If you'd like to know how many failed login attempts are made to Home Assistant, add the following to your `configuration.yaml` file:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -491,13 +466,11 @@ command_line:
name: Badlogin name: Badlogin
command: "grep -c 'Login attempt' /home/hass/.homeassistant/home-assistant.log" command: "grep -c 'Login attempt' /home/hass/.homeassistant/home-assistant.log"
``` ```
{% endraw%} {% endraw%}
Make sure to configure the [Logger integration](/integrations/logger) to monitor the [HTTP integration](/integrations/http/) at least the `warning` level. Make sure to configure the [Logger integration](/integrations/logger) to monitor the [HTTP integration](/integrations/http/) at least the `warning` level.
{% raw %} {% raw %}
```yaml ```yaml
# Example working logger settings that works # Example working logger settings that works
logger: logger:
@ -505,7 +478,6 @@ logger:
logs: logs:
homeassistant.components.http: warning homeassistant.components.http: warning
``` ```
{% endraw%} {% endraw%}
### Details about the upstream Home Assistant release ### Details about the upstream Home Assistant release
@ -513,14 +485,12 @@ logger:
You can see directly in the frontend (**Developer tools** -> **About**) what release of Home Assistant you are running. The Home Assistant releases are available on the [Python Package Index](https://pypi.python.org/pypi). This makes it possible to get the current release. You can see directly in the frontend (**Developer tools** -> **About**) what release of Home Assistant you are running. The Home Assistant releases are available on the [Python Package Index](https://pypi.python.org/pypi). This makes it possible to get the current release.
{% raw %} {% raw %}
```yaml ```yaml
command_line: command_line:
- sensor: - sensor:
command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])" command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])"
name: HA release name: HA release
``` ```
{% endraw%} {% endraw%}
### Read value out of a remote text file ### Read value out of a remote text file
@ -528,14 +498,12 @@ command_line:
If you own devices which are storing values in text files which are accessible over HTTP then you can use the same approach as shown in the previous section. Instead of looking at the JSON response we directly grab the sensor's value. If you own devices which are storing values in text files which are accessible over HTTP then you can use the same approach as shown in the previous section. Instead of looking at the JSON response we directly grab the sensor's value.
{% raw %} {% raw %}
```yaml ```yaml
command_line: command_line:
- sensor: - sensor:
command: python3 -c "import requests; print(requests.get('http://remote-host/sensor_data.txt').text)" command: python3 -c "import requests; print(requests.get('http://remote-host/sensor_data.txt').text)"
name: File value name: File value
``` ```
{% endraw%} {% endraw%}
### Use an external script ### Use an external script
@ -545,17 +513,14 @@ The example is doing the same as the [aREST sensor](/integrations/arest#sensor)
The one-line script to retrieve a value is shown below. Of course it would be possible to use this directly in the `configuration.yaml` file but need extra care about the quotation marks. The one-line script to retrieve a value is shown below. Of course it would be possible to use this directly in the `configuration.yaml` file but need extra care about the quotation marks.
{% raw %} {% raw %}
```bash ```bash
python3 -c "import requests; print(requests.get('http://10.0.0.48/analog/2').json()['return_value'])" python3 -c "import requests; print(requests.get('http://10.0.0.48/analog/2').json()['return_value'])"
``` ```
{% endraw%} {% endraw%}
The script (saved as `arest-value.py`) that is used looks like the example below. The script (saved as `arest-value.py`) that is used looks like the example below.
{% raw %} {% raw %}
```python ```python
#!/usr/bin/python3 #!/usr/bin/python3
from requests import get from requests import get
@ -563,13 +528,11 @@ from requests import get
response = get("http://10.0.0.48/analog/2") response = get("http://10.0.0.48/analog/2")
print(response.json()["return_value"]) print(response.json()["return_value"])
``` ```
{% endraw%} {% endraw%}
To use the script you need to add something like the following to your `configuration.yaml` file. To use the script you need to add something like the following to your `configuration.yaml` file.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -577,7 +540,6 @@ command_line:
name: Brightness name: Brightness
command: "python3 /path/to/script/arest-value.py" command: "python3 /path/to/script/arest-value.py"
``` ```
{% endraw%} {% endraw%}
### Usage of templating in `command:` ### Usage of templating in `command:`
@ -585,7 +547,6 @@ command_line:
[Templates](/docs/configuration/templating/) are supported in the `command` configuration variable. This could be used if you want to include the state of a specific sensor as an argument to your external script. [Templates](/docs/configuration/templating/) are supported in the `command` configuration variable. This could be used if you want to include the state of a specific sensor as an argument to your external script.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -594,7 +555,6 @@ command_line:
command: "sh /home/pi/.homeassistant/scripts/wind_direction.sh {{ states('sensor.wind_direction') }}" command: "sh /home/pi/.homeassistant/scripts/wind_direction.sh {{ states('sensor.wind_direction') }}"
unit_of_measurement: "Direction" unit_of_measurement: "Direction"
``` ```
{% endraw%} {% endraw%}
### Usage of JSON attributes in command output ### Usage of JSON attributes in command output
@ -602,7 +562,6 @@ command_line:
The example shows how you can retrieve multiple values with one sensor (where the additional values are attributes) by using `value_json` and `json_attributes`. The example shows how you can retrieve multiple values with one sensor (where the additional values are attributes) by using `value_json` and `json_attributes`.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -614,7 +573,6 @@ command_line:
command: "python3 /home/pi/.homeassistant/scripts/datetime.py" command: "python3 /home/pi/.homeassistant/scripts/datetime.py"
value_template: "{{ value_json.time }}" value_template: "{{ value_json.time }}"
``` ```
{% endraw%} {% endraw%}
## Example switch platform ## Example switch platform
@ -624,7 +582,6 @@ command_line:
This example demonstrates how to use template to change the icon as its state changes. This icon is referencing its own state. This example demonstrates how to use template to change the icon as its state changes. This icon is referencing its own state.
{% raw %} {% raw %}
```yaml ```yaml
command_line: command_line:
- switch: - switch:
@ -641,7 +598,6 @@ command_line:
{% else %} mdi:toggle-switch-off {% else %} mdi:toggle-switch-off
{% endif %} {% endif %}
``` ```
{% endraw%} {% endraw%}
### aREST device ### aREST device
@ -652,7 +608,6 @@ The command line tool [`curl`](https://curl.haxx.se/) is used to toggle a pin
which is controllable through REST. which is controllable through REST.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -663,7 +618,6 @@ command_line:
value_template: '{{ value == "1" }}' value_template: '{{ value == "1" }}'
name: Kitchen Lightswitch name: Kitchen Lightswitch
``` ```
{% endraw%} {% endraw%}
Given this example, in the UI one would see the `friendly_name` of Given this example, in the UI one would see the `friendly_name` of
@ -680,7 +634,6 @@ This switch will shutdown your host immediately, there will be no confirmation.
</div> </div>
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -688,7 +641,6 @@ command_line:
name: Home Assistant System Shutdown name: Home Assistant System Shutdown
command_off: "/usr/sbin/poweroff" command_off: "/usr/sbin/poweroff"
``` ```
{% endraw%} {% endraw%}
### Control your VLC player ### Control your VLC player
@ -697,7 +649,6 @@ This switch will control a local VLC media player
([Source](https://community.home-assistant.io/t/vlc-player/106)). ([Source](https://community.home-assistant.io/t/vlc-player/106)).
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -706,7 +657,6 @@ command_line:
command_on: "cvlc 1.mp3 vlc://quit &" command_on: "cvlc 1.mp3 vlc://quit &"
command_off: "pkill vlc" command_off: "pkill vlc"
``` ```
{% endraw%} {% endraw%}
### Control Foscam Motion Sensor ### Control Foscam Motion Sensor
@ -717,7 +667,6 @@ This switch supports statecmd,
which checks the current state of motion detection. which checks the current state of motion detection.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
command_line: command_line:
@ -728,7 +677,6 @@ command_line:
command_state: 'curl -k --silent "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password" | grep -oP "(?<=isEnable>).*?(?=</isEnable>)"' command_state: 'curl -k --silent "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password" | grep -oP "(?<=isEnable>).*?(?=</isEnable>)"'
value_template: '{{ value == "1" }}' value_template: '{{ value == "1" }}'
``` ```
{% endraw%} {% endraw%}
- Replace admin and password with an "Admin" privileged Foscam user - Replace admin and password with an "Admin" privileged Foscam user

View File

@ -25,40 +25,41 @@ tts:
{% configuration %} {% configuration %}
language: language:
description: "The default speech language to use." description: "The default speech language to use."
required: false required: false
type: string type: string
default: "`en`" default: "`en`"
tld: tld:
description: "The default Google domain you want to use to choose dialect." description: "The default Google domain you want to use to choose dialect."
required: false required: false
type: string type: string
default: "`com`" default: "`com`"
{% endconfiguration %} {% endconfiguration %}
Check the [complete list of supported languages](https://translate.google.com/intl/en_ALL/about/languages/) (languages where "Talk" feature is enabled in Google Translate) for allowed values. Check the [complete list of supported languages](https://translate.google.com/intl/en_ALL/about/languages/) (languages where "Talk" feature is enabled in Google Translate) for allowed values.
Use the 2-digit language code which you can find at the end of the URL when you click on the language name. Use the 2-digit language code which you can find at the end of the URL when you click on the language name.
Check the [complete list of supported tld](https://www.google.com/supported_domains) for allowed TLD values. This is used to force the dialect used when multiple fall into the same 2-digit language code(i.e., _US, UK, AU_) Check the [complete list of supported tld](https://www.google.com/supported_domains) for allowed TLD values. This is used to force the dialect used when multiple fall into the same 2-digit language code(i.e., *US, UK, AU*)
You can also use supported BCP 47 tags like the below or the 2-2 digit format for your supported dialect(`en-gb` or `en-us`). Below is a list of the currently implemented mappings: You can also use supported BCP 47 tags like the below or the 2-2 digit format for your supported dialect(`en-gb` or `en-us`). Below is a list of the currently implemented mappings:
| Dialect | Language | TLD | | Dialect | Language | TLD |
| ------- | -------- | ------ | |---------|----------|-----|
| en-us | en | com | |en-us|en|com|
| en-gb | en | co.uk | |en-gb|en|co.uk|
| en-uk | en | co.uk | |en-uk|en|co.uk|
| en-au | en | com.au | |en-au|en|com.au|
| en-ca | en | ca | |en-ca|en|ca|
| en-in | en | co.in | |en-in|en|co.in|
| en-ie | en | ie | |en-ie|en|ie|
| en-za | en | co.za | |en-za|en|co.za|
| fr-ca | fr | ca | |fr-ca|fr|ca|
| fr-fr | fr | fr | |fr-fr|fr|fr|
| pt-br | pt | com.br | |pt-br|pt|com.br|
| pt-pt | pt | pt | |pt-pt|pt|pt|
| es-es | es | es | |es-es|es|es|
| es-us | es | com | |es-us|es|com|
## Full configuration example ## Full configuration example