From 3ef83dc16152fa77b4ef06e8935bceb5cfda91b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Hedenstr=C3=B6m?= <erik@hedenstroem.com> Date: Mon, 9 Oct 2023 15:17:53 +0000 Subject: [PATCH] Added bicycle charger automation --- automation/bicycle-charger-notification.yaml | 78 ++++++++++++++++++++ automation/coffee-brewer-notification.yaml | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 automation/bicycle-charger-notification.yaml diff --git a/automation/bicycle-charger-notification.yaml b/automation/bicycle-charger-notification.yaml new file mode 100644 index 0000000..28bbf38 --- /dev/null +++ b/automation/bicycle-charger-notification.yaml @@ -0,0 +1,78 @@ +blueprint: + name: Bicycle Charger Notification + description: Get notified when the bicycle battery is fully charged + domain: automation + input: + power_switch: + name: Charger Switch + description: The switch turns the charger on/off. + selector: + entity: + domain: switch + power_sensor: + name: Charger Power Sensor + description: The power sensor of your charger. + selector: + entity: + domain: sensor + device_class: power + is_charging: + name: Charging State + description: The toggle helper that stores if the bicycle is charging. + selector: + entity: + domain: input_boolean + notify_device: + name: Device to notify + description: Device needs to run the official Home Assistant app to receive notifications. + selector: + device: + integration: mobile_app + +mode: single + +trigger: + - platform: numeric_state + entity_id: !input power_sensor + for: + hours: 0 + minutes: 0 + seconds: 30 + above: 80 + - platform: numeric_state + entity_id: !input power_sensor + for: + hours: 0 + minutes: 1 + seconds: 0 + below: 3 + +action: + - choose: + - conditions: + - condition: numeric_state + entity_id: !input power_sensor + above: 80 + sequence: + - service: input_boolean.turn_on + target: + entity_id: !input is_charging + - conditions: + - condition: numeric_state + entity_id: !input power_sensor + below: 3 + - condition: state + entity_id: !input is_charging + state: "on" + sequence: + - device_id: !input notify_device + domain: mobile_app + type: notify + title: Bicycle Battery + message: The battery is fully charged! + - service: switch.turn_off + target: + entity_id: !input power_switch + - service: input_boolean.turn_off + target: + entity_id: !input is_charging diff --git a/automation/coffee-brewer-notification.yaml b/automation/coffee-brewer-notification.yaml index 80b3155..0071895 100644 --- a/automation/coffee-brewer-notification.yaml +++ b/automation/coffee-brewer-notification.yaml @@ -1,5 +1,5 @@ blueprint: - name: Coffee Brewer Notifications + name: Coffee Brewer Notification description: Get notifications when your coffee is ready and when it is getting cold. domain: automation input: -- GitLab