From 86e332b2f6eeb7da4f5eb794d36944d613aa78cd Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Mon, 1 May 2023 18:15:52 +0300 Subject: [PATCH] Update mercury --- .../advanced_dashboard/08_automations.yaml | 2 + config/packages/devices/mercury.yaml | 40 +++++++++++++++++++ config/secrets.example.yaml | 2 + 3 files changed, 44 insertions(+) create mode 100644 config/packages/devices/mercury.yaml diff --git a/config/lovelace/advanced_dashboard/08_automations.yaml b/config/lovelace/advanced_dashboard/08_automations.yaml index f7a2b05..57ced0d 100644 --- a/config/lovelace/advanced_dashboard/08_automations.yaml +++ b/config/lovelace/advanced_dashboard/08_automations.yaml @@ -126,6 +126,8 @@ cards: show_header_toggle: false entities: - automation.guest_mode_change + - automation.mercury_power_on_at_10am_when_guest_mode_enabled + - automation.mercury_power_off_at_10pm_when_guest_mode_enabled - type: entities title: Domestina diff --git a/config/packages/devices/mercury.yaml b/config/packages/devices/mercury.yaml new file mode 100644 index 0000000..d93e280 --- /dev/null +++ b/config/packages/devices/mercury.yaml @@ -0,0 +1,40 @@ +script: + mercury_start: + alias: Mercury · Start + icon: mdi:play-box-outline + sequence: + - service: wake_on_lan.send_magic_packet + data: + mac: !secret mercury_mac + +automation: + - alias: Mercury · Power on at 10am when guest mode enabled + trigger: + - platform: time + at: "11:00:00" + condition: + condition: state + entity_id: input_boolean.guest_mode + state: "on" + action: + - service: script.mercury_start + - service: notify.telegram + data_template: + title: "*Mercury · Powering on*" + message: "11:00 · Powering Mercury on (guest mode enabled)" + + - alias: Mercury · Power off at 10pm when guest mode enabled + trigger: + - platform: time + at: "22:00:00" + condition: + condition: state + entity_id: input_boolean.guest_mode + state: "on" + action: + - service: button.press + entity_id: button.mercury_shutdown + - service: notify.telegram + data_template: + title: "*Mercury · Powering off*" + message: "22:00 · Powering Mercury off (guest mode enabled)" diff --git a/config/secrets.example.yaml b/config/secrets.example.yaml index 113df7b..a72e476 100644 --- a/config/secrets.example.yaml +++ b/config/secrets.example.yaml @@ -20,6 +20,8 @@ sarah_url: http://localhost:8123 cadmium_ip: 127.0.0.1 cadmium_mac: 00:00:00:00:00:00:00:00 +mercury_mac: 00:00:00:00:00:00:00:00 + amcrest_ip: 127.0.0.1 amcrest_username: user amcrest_password: pass