Files
fresh-home/components/packages/clints_watch.yaml
T
2024-04-14 14:08:56 -04:00

61 lines
1.8 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 ['unkown', '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 ['unkown', '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