mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-24 17:57:14 +00:00
Add scan_interval option to Command line (#27580)
This commit is contained in:
parent
718a2e49f9
commit
9f95073041
@ -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.
|
||||||
@ -57,7 +57,7 @@ command_line:
|
|||||||
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
|
||||||
@ -76,6 +76,11 @@ command_line:
|
|||||||
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:
|
||||||
|
description: Define time in seconds between each update.
|
||||||
|
required: false
|
||||||
|
type: integer
|
||||||
|
default: 60
|
||||||
cover:
|
cover:
|
||||||
description: Cover platform.
|
description: Cover platform.
|
||||||
required: false
|
required: false
|
||||||
@ -117,6 +122,11 @@ command_line:
|
|||||||
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:
|
||||||
|
description: Define time in seconds between each update.
|
||||||
|
required: false
|
||||||
|
type: integer
|
||||||
|
default: 15
|
||||||
notify:
|
notify:
|
||||||
description: Notify platform.
|
description: Notify platform.
|
||||||
required: false
|
required: false
|
||||||
@ -170,6 +180,11 @@ command_line:
|
|||||||
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:
|
||||||
|
description: Define time in seconds between each update.
|
||||||
|
required: false
|
||||||
|
type: integer
|
||||||
|
default: 60
|
||||||
switch:
|
switch:
|
||||||
description: Switch platform.
|
description: Switch platform.
|
||||||
required: false
|
required: false
|
||||||
@ -208,6 +223,11 @@ command_line:
|
|||||||
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:
|
||||||
|
description: Define time in seconds between each update.
|
||||||
|
required: false
|
||||||
|
type: integer
|
||||||
|
default: 30
|
||||||
{% endconfiguration %}
|
{% endconfiguration %}
|
||||||
|
|
||||||
## Binary sensor
|
## Binary sensor
|
||||||
@ -215,12 +235,14 @@ command_line:
|
|||||||
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
|
||||||
@ -230,6 +252,7 @@ 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:
|
||||||
@ -239,6 +262,7 @@ command_line:
|
|||||||
command_stop: move_command stop garage
|
command_stop: move_command stop garage
|
||||||
name: Garage
|
name: Garage
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endraw%}
|
{% endraw%}
|
||||||
|
|
||||||
## Notify
|
## Notify
|
||||||
@ -248,12 +272,14 @@ 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/).
|
||||||
@ -263,12 +289,14 @@ 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
|
||||||
@ -281,6 +309,7 @@ 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:
|
||||||
@ -289,6 +318,7 @@ 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'>
|
||||||
@ -322,6 +352,7 @@ 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:
|
||||||
@ -332,6 +363,7 @@ command_line:
|
|||||||
payload_on: "Running"
|
payload_on: "Running"
|
||||||
payload_off: "Not running"
|
payload_off: "Not running"
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endraw%}
|
{% endraw%}
|
||||||
|
|
||||||
### Check RasPlex
|
### Check RasPlex
|
||||||
@ -339,6 +371,7 @@ 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:
|
||||||
@ -348,20 +381,23 @@ 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.
|
||||||
@ -371,6 +407,7 @@ 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
|
||||||
@ -378,23 +415,27 @@ $ 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:
|
||||||
@ -411,6 +452,7 @@ command_line:
|
|||||||
0
|
0
|
||||||
{% endif %}
|
{% endif %}
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endraw%}
|
{% endraw%}
|
||||||
|
|
||||||
## Examples sensor platform
|
## Examples sensor platform
|
||||||
@ -422,6 +464,7 @@ 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:
|
||||||
@ -432,6 +475,7 @@ 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
|
||||||
@ -439,6 +483,7 @@ 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:
|
||||||
@ -446,11 +491,13 @@ 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:
|
||||||
@ -458,6 +505,7 @@ 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
|
||||||
@ -465,12 +513,14 @@ 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
|
||||||
@ -478,12 +528,14 @@ 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
|
||||||
@ -493,14 +545,17 @@ 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
|
||||||
@ -508,11 +563,13 @@ 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:
|
||||||
@ -520,6 +577,7 @@ 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:`
|
||||||
@ -527,6 +585,7 @@ 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:
|
||||||
@ -535,6 +594,7 @@ 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
|
||||||
@ -542,6 +602,7 @@ 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:
|
||||||
@ -553,6 +614,7 @@ 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
|
||||||
@ -562,6 +624,7 @@ 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:
|
||||||
@ -578,6 +641,7 @@ command_line:
|
|||||||
{% else %} mdi:toggle-switch-off
|
{% else %} mdi:toggle-switch-off
|
||||||
{% endif %}
|
{% endif %}
|
||||||
```
|
```
|
||||||
|
|
||||||
{% endraw%}
|
{% endraw%}
|
||||||
|
|
||||||
### aREST device
|
### aREST device
|
||||||
@ -588,6 +652,7 @@ 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:
|
||||||
@ -598,6 +663,7 @@ 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
|
||||||
@ -614,6 +680,7 @@ 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:
|
||||||
@ -621,6 +688,7 @@ 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
|
||||||
@ -629,6 +697,7 @@ 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:
|
||||||
@ -637,6 +706,7 @@ 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
|
||||||
@ -647,6 +717,7 @@ 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:
|
||||||
@ -657,6 +728,7 @@ 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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user