Merge PR #1639: Migrate docker_monitored_containers to modern Group integration
Migrate docker_monitored_containers to modern Group integrationpull/1640/head
commit
8df520c930
@ -0,0 +1,99 @@
|
||||
######################################################################
|
||||
# @CCOSTAN - Follow Me on X
|
||||
# For more info visit https://www.vcloudinfo.com/click-here
|
||||
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||
# -------------------------------------------------------------------
|
||||
# Tesla Model Y - Arrival and nightly plug-in reminders
|
||||
# Garage speech + parents push reminders when the Tesla comes home low.
|
||||
# -------------------------------------------------------------------
|
||||
# Related Issue: 1279
|
||||
# Notes: Expects Tesla Fleet UI entities `sensor.spaceship_battery_level`
|
||||
# and `switch.spaceship_charge`.
|
||||
# Notes: Uses `device_tracker.spaceship_location` for arrival/home state.
|
||||
# Notes: The nightly parents reminder starts at 8 PM, waits until the
|
||||
# car is home, then loops every 30 minutes via a custom event until it
|
||||
# is charging or no longer home.
|
||||
######################################################################
|
||||
|
||||
automation:
|
||||
- alias: "Tesla Model Y - Garage Plug In Reminder"
|
||||
id: 6a873341-c823-4d5d-9d42-fc2df52b93db
|
||||
mode: restart
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: device_tracker.spaceship_location
|
||||
to: 'home'
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: >-
|
||||
{{ trigger.from_state is not none and
|
||||
trigger.from_state.state not in ['home', 'unknown', 'unavailable'] }}
|
||||
- condition: template
|
||||
value_template: >-
|
||||
{% set battery = states('sensor.spaceship_battery_level') %}
|
||||
{{ battery not in ['unknown', 'unavailable', 'none', ''] and
|
||||
(battery | float(100)) < 50 and
|
||||
is_state('switch.spaceship_charge', 'off') }}
|
||||
action:
|
||||
- wait_for_trigger:
|
||||
- platform: state
|
||||
entity_id: cover.large_garage_door
|
||||
from: 'closed'
|
||||
to: 'open'
|
||||
for: '00:03:20'
|
||||
timeout: '00:10:00'
|
||||
continue_on_timeout: false
|
||||
- condition: template
|
||||
value_template: >-
|
||||
{% set battery = states('sensor.spaceship_battery_level') %}
|
||||
{{ battery not in ['unknown', 'unavailable', 'none', ''] and
|
||||
(battery | float(100)) < 50 and
|
||||
is_state('switch.spaceship_charge', 'off') }}
|
||||
- service: notify.alexa_media_garage
|
||||
data:
|
||||
message: >-
|
||||
Reminder: the Tesla battery is at
|
||||
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
|
||||
Please plug in the Model Y.
|
||||
data:
|
||||
type: announce
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "TESLA"
|
||||
message: >-
|
||||
Garage reminder announced to plug in the Model Y at
|
||||
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
|
||||
|
||||
- alias: "Tesla Model Y - Nightly Plug In Reminder"
|
||||
id: 8b243b63-f5c3-4436-b596-0ec00a2108ab
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: time
|
||||
at: '20:00:00'
|
||||
- platform: event
|
||||
event_type: event_tesla_model_y_nightly_loop
|
||||
action:
|
||||
- wait_template: "{{ is_state('device_tracker.spaceship_location', 'home') }}"
|
||||
- condition: template
|
||||
value_template: >-
|
||||
{% set battery = states('sensor.spaceship_battery_level') %}
|
||||
{{ is_state('device_tracker.spaceship_location', 'home') and
|
||||
battery not in ['unknown', 'unavailable', 'none', ''] and
|
||||
(battery | float(100)) < 50 and
|
||||
is_state('switch.spaceship_charge', 'off') }}
|
||||
- service: script.notify_engine
|
||||
data:
|
||||
title: "Tesla Plug In Reminder"
|
||||
value1: >-
|
||||
The Model Y is home, below 50 percent, and not plugged in.
|
||||
Current battery:
|
||||
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
|
||||
who: 'parents'
|
||||
group: 'Tesla_Model_Y'
|
||||
- service: script.send_to_logbook
|
||||
data:
|
||||
topic: "TESLA"
|
||||
message: >-
|
||||
Nightly plug-in reminder sent because the Model Y is home below 50 percent and not charging.
|
||||
- delay: '00:30:00'
|
||||
- event: event_tesla_model_y_nightly_loop
|
||||
@ -0,0 +1,129 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Open OneNote</title>
|
||||
<style>
|
||||
:root { color-scheme: light; }
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
background: linear-gradient(180deg, #f5f7fb 0%, #e8eef8 100%);
|
||||
color: #122033;
|
||||
}
|
||||
main {
|
||||
max-width: 32rem;
|
||||
margin: 0 auto;
|
||||
min-height: 100vh;
|
||||
padding: 2rem 1.25rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
.card {
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
border: 1px solid rgba(18, 32, 51, 0.08);
|
||||
border-radius: 18px;
|
||||
box-shadow: 0 18px 40px rgba(18, 32, 51, 0.12);
|
||||
padding: 1.25rem;
|
||||
}
|
||||
h1 {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 1.35rem;
|
||||
line-height: 1.2;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.title {
|
||||
margin-top: 0.75rem;
|
||||
font-size: 0.95rem;
|
||||
color: #41556f;
|
||||
word-break: break-word;
|
||||
}
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.button {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
padding: 0.9rem 1rem;
|
||||
border-radius: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.button.primary {
|
||||
background: #166534;
|
||||
color: #fff;
|
||||
}
|
||||
.button.secondary {
|
||||
background: #fff;
|
||||
color: #122033;
|
||||
border: 1px solid rgba(18, 32, 51, 0.14);
|
||||
}
|
||||
.hint {
|
||||
font-size: 0.88rem;
|
||||
color: #5c708a;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<section class="card">
|
||||
<h1>Opening OneNote</h1>
|
||||
<p>Joanna is handing this note to the OneNote app now.</p>
|
||||
<p id="note-title" class="title"></p>
|
||||
<div class="actions">
|
||||
<a id="app-link" class="button primary" href="#">Open in OneNote App</a>
|
||||
<a id="web-link" class="button secondary" href="https://www.onenote.com/">Open Web Copy</a>
|
||||
</div>
|
||||
<p class="hint">If the app does not open automatically in a second or two, tap the OneNote button.</p>
|
||||
</section>
|
||||
</main>
|
||||
<script>
|
||||
(function () {
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
var clientUrl = String(params.get('client') || '').trim();
|
||||
var webUrl = String(params.get('web') || '').trim() || 'https://www.onenote.com/';
|
||||
var title = String(params.get('title') || '').trim();
|
||||
var appLink = document.getElementById('app-link');
|
||||
var webLink = document.getElementById('web-link');
|
||||
var titleNode = document.getElementById('note-title');
|
||||
|
||||
if (title) {
|
||||
titleNode.textContent = title;
|
||||
} else {
|
||||
titleNode.textContent = 'OneNote note';
|
||||
}
|
||||
|
||||
webLink.href = webUrl;
|
||||
if (!/^onenote:/i.test(clientUrl)) {
|
||||
appLink.style.display = 'none';
|
||||
window.location.replace(webUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
appLink.href = clientUrl;
|
||||
var fallbackTimer = window.setTimeout(function () {
|
||||
window.location.replace(webUrl);
|
||||
}, 1400);
|
||||
var cancelFallback = function () {
|
||||
window.clearTimeout(fallbackTimer);
|
||||
};
|
||||
window.addEventListener('pagehide', cancelFallback, { once: true });
|
||||
document.addEventListener('visibilitychange', function () {
|
||||
if (document.visibilityState === 'hidden') {
|
||||
cancelFallback();
|
||||
}
|
||||
}, { once: true });
|
||||
window.location.href = clientUrl;
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in new issue