Skip to content

Instantly share code, notes, and snippets.

@dadge
dadge / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active November 20, 2022 19:52 — forked from sbyx/low-battery-level-detection-notification-for-all-battery-sensors.yaml
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Batteries Warning
description: Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold or unseen sensor and if so execute an action.
domain: automation
input:
threshold:
name: Battery warning level threshold
description: Battery sensors below threshold are assumed to be low-battery (as
well as binary battery sensors with value 'on').
@dadge
dadge / sw.js
Created October 27, 2022 14:37 — forked from felquis/sw.js
sw.js
/*
Copyright 2014 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and