mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
62 lines
1.9 KiB
YAML
62 lines
1.9 KiB
YAML
template:
|
|
# Watch Done Charging
|
|
- trigger:
|
|
- platform: state
|
|
entity_id: sensor.ticwatch_pro_3_gps_charger_type
|
|
|
|
- platform: state
|
|
entity_id: sensor.ticwatch_pro_3_gps_battery_level
|
|
|
|
- platform: event
|
|
event_type: event_template_reloaded
|
|
id: "reload"
|
|
|
|
- platform: homeassistant
|
|
event: start
|
|
|
|
binary_sensor:
|
|
- name: Clint's Watch Done Charging
|
|
unique_id: templatebinarysensor.clints_watch_done_charging
|
|
icon: mdi:battery-charging-100
|
|
availability: "{{ states('sensor.ticwatch_pro_3_gps_battery_level') not in ['unknown', 'unavailable'] }}"
|
|
state: "{{ states('sensor.ticwatch_pro_3_gps_battery_level')|int(default=0) >= states('input_number.clints_watch_charged')|int(default=0) and is_state('sensor.ticwatch_pro_3_gps_charger_type','ac') }}"
|
|
|
|
# Watch Done Charging
|
|
- trigger:
|
|
- platform: state
|
|
entity_id: sensor.ticwatch_pro_3_gps_charger_type
|
|
|
|
- platform: state
|
|
entity_id: sensor.ticwatch_pro_3_gps_battery_level
|
|
|
|
- platform: event
|
|
event_type: event_template_reloaded
|
|
id: "reload"
|
|
|
|
- platform: homeassistant
|
|
event: start
|
|
|
|
binary_sensor:
|
|
- name: Clint's Watch Needs to Charge
|
|
unique_id: templatebinarysensor.clints_watch_needs_to_charge
|
|
icon: mdi:battery-20
|
|
availability: "{{ states('sensor.ticwatch_pro_3_gps_battery_level') not in ['unknown', 'unavailable'] }}"
|
|
state: "{{ states('sensor.ticwatch_pro_3_gps_battery_level')|int(default=0) <= states('input_number.clints_watch_low')|int(default=0) and is_state('sensor.ticwatch_pro_3_gps_charger_type','none') }}"
|
|
|
|
input_number:
|
|
clints_watch_charged:
|
|
name: "Clints Watch Charged"
|
|
icon: mdi:battery
|
|
min: 0
|
|
max: 100
|
|
step: 1
|
|
mode: box
|
|
|
|
clints_watch_low:
|
|
name: "Clints Watch Low"
|
|
icon: mdi:battery-20
|
|
min: 0
|
|
max: 100
|
|
step: 1
|
|
mode: box
|