Created
March 8, 2021 07:46
-
-
Save chpego/cc0bdcf1d4475d1b2247b80393f24743 to your computer and use it in GitHub Desktop.
tablette.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
automation: | |
- alias: "[System] - Chargement Tablette" | |
trigger: | |
- platform: numeric_state | |
entity_id: sensor.tablette_info | |
attribute: batteryLevel | |
above: 0 | |
below: 6 | |
- platform: state | |
entity_id: sensor.tablette_info | |
attribute: batteryLevel | |
to: 100 | |
action: | |
- choose: | |
- conditions: | |
- condition: numeric_state | |
entity_id: sensor.tablette_info | |
attribute: batteryLevel | |
above: 0 | |
below: 6 | |
sequence: | |
- service: switch.turn_on | |
entity_id: switch.XXXXXXXXX | |
- conditions: | |
- condition: state | |
entity_id: switch.XXXXXXXXX | |
state: "on" | |
- condition: numeric_state | |
entity_id: sensor.tablette_info | |
attribute: batteryLevel | |
above: 99 | |
sequence: | |
- service: switch.turn_off | |
entity_id: switch.XXXXXXXXX | |
sensor: | |
- platform: rest | |
name: tablette_info | |
resource: !secret rest_url_kiosk_device_info | |
json_attributes: | |
- batteryLevel | |
- isPlugged | |
value_template: "OK" | |
scan_interval: 300 | |
secret: | |
rest_url_kiosk_device_info: 'http://NOM-OU-ADRESSE-IP:2323/?cmd=deviceInfo&type=json&password=XXXXXXXXX' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment