Skip to content

Instantly share code, notes, and snippets.

@D34DC3N73R
D34DC3N73R / motion.yaml
Last active January 29, 2024 17:10
Add motion sensors to light button cards - Add motion.yaml to the button_card_templates directory. Add variables: motion: and define the motion sensor entity_id in your light button card. If you want the card to update with the motion sensor and light entity state (rather than only the light entity), you'll also need to add the motion entity to …
motion:
custom_fields:
motion: |
[[[
const motionSensor = states[this._config?.triggers_update];
return motionSensor && motionSensor.state == 'on'
? '<ha-icon icon="mdi:motion-sensor" style="width:100%;display:flex;color:var(--state-icon-active-color);"></ha-icon>'
: '<ha-icon icon="mdi:motion-sensor-off" style="width:100%;display:flex;color:var(--state-icon-color);"></ha-icon>';
]]]
styles:
@D34DC3N73R
D34DC3N73R / progress_bar.yaml
Last active January 6, 2024 10:56
This will add a progress bar to conditional media cards. Add progress_bar.yaml to button_card_templates directory. Add the lines from themes.yaml to themes.yaml. Add - progress_bar to conditional_media cards in ui-lovelace.yaml
progress_bar:
styles:
custom_fields:
progress:
- background-color: var(--progress-bar-background-color)
- position: absolute
- left: 0%
- top: 73.9%
- height: var(--progress-bar-height)
- width: 100%
@D34DC3N73R
D34DC3N73R / aired_today_playlist.py
Created October 5, 2017 18:32 — forked from blacktwin/aired_today_playlist.py
Create a Plex Playlist with what was aired on this today's month-day, sort by oldest first, using PlexAPI
"""
Create a Plex Playlist with what was aired on this today's month-day, sort by oldest first.
If Playlist from yesterday exists delete and create today's.
If today's Playlist exists exit.
"""
import operator, time
from plexapi.server import PlexServer
import requests