Skip to content

Instantly share code, notes, and snippets.

@sstratoti
sstratoti / plex_sessions.yaml
Created July 5, 2024 02:16
Creates the template sensors for the Tautulli REST Button Card I created.
# Now with all 10! Too big for the forum post, so sharing via gist.
template:
- sensor:
- unique_id: plex_session_1
name: Plex Session 1 (Tautulli)
icon: mdi:plex
state: >
{% if (state_attr('sensor.tautulli_activity','sessions')|length >= 1)%}{{ state_attr('sensor.tautulli_activity','sessions')[0].state }}{%else%}off{%endif %}
attributes:
user: >
binary_sensor:
- platform: template
sensors:
2nd_floor_hvac_cooling:
value_template: "{{ is_state_attr('climate.my_ecobee3', 'hvac_action', 'cooling') }}"
friendly_name: HVAC Cooling
- platform: template
sensors:
2nd_floor_fan_running:
value_template: "{{ is_state_attr('climate.my_ecobee3', 'fan', 'on') }}"
- cards:
- entity: input_boolean.manual_frankie_pill
template: dow_time_warning_card
variables:
var_dow: sensor.last_pill_day_of_week
var_time: sensor.last_pill_time
var_critical_input_boolean: input_boolean.frankie_needs_pill
var_warning_input_boolean: input_boolean.frankie_needs_pill_warning
triggers_update:
- sensor.last_pill_day_of_week
button_card_templates:
dow_time_warning_card:
variables:
var_dow: ''
var_time: ''
var_critical_input_boolean: ''
var_warning_input_boolean: ''
custom_fields:
dow: |
[[[
card:
name: '[[[return states["sensor.active_alerts"].attributes.name]]]'
icon: '[[[return states["sensor.active_alerts"].attributes.icon]]]'
show_state: '[[[return states["sensor.active_alerts"].attributes.label != '']]]'
show_name: '[[[return states["sensor.active_alerts"].attributes.name != '']]]'
show_icon: '[[[return states["sensor.active_alerts"].attributes.icon != '']]]'
show_label: '[[[return states["sensor.active_alerts"].attributes.label != '']]]'
label: '[[[return states["sensor.active_alerts"].attributes.label]]]'
entity: null
state_display: |
@sstratoti
sstratoti / HAUpdateFlow.json
Created August 17, 2021 00:59
HA Active Alert Update Flow
[
{
"id": "90e68c3c3bca25ff",
"type": "ha-entity",
"z": "eff29b39482d7ed4",
"name": "Active Alert",
"server": "74f36281.ae094c",
"version": 1,
"debugenabled": false,
"outputs": 1,
@sstratoti
sstratoti / HAAlertQueueSubflow.json
Last active August 17, 2021 01:04
HA Alert Queue Subflow
[
{
"id": "eec8b4376623cc26",
"type": "subflow",
"name": "HA Alert Queue",
"info": "",
"category": "",
"in": [
{
"x": 180,
@sstratoti
sstratoti / actionable-notifications-subflow-for-ios.md
Last active April 15, 2024 00:49
iOS Subflow for HomeAssistant Companion notifications
@sstratoti
sstratoti / RoomAssistantCustomButtonCard.yaml
Created March 21, 2021 15:59
Room Assistant Custom Button Card
type: 'custom:button-card'
color: black
color_type: icon
custom_fields:
date: |
[[[
return `<span style="color: var(--text-color-sensor);">${states['sensor.nodered_[whatever 1st entity Node Red Creates through integration]'].state}</span>`
]]]
time: |
[[[
@sstratoti
sstratoti / roomassistantapiparser.js
Created March 21, 2021 15:39
Room Assistant API Data Parser
msg.notification = '';
msg.notification_in = '';
for (i=0; i < msg.payload.length; i++){
if (msg.payload[i].name == "Steves-iPhone-BLE Room Presence"){
if (msg.payload[i].distances['Living Room'].outOfRange) {
msg.notification += "<br> Living Room Out Of Range (" + msg.payload[i].distances['Living Room'].distance + ")";
} else {
msg.notification_in += " <br> Living Room (" + msg.payload[i].distances['Living Room'].distance + ")";
}
if (msg.payload[i].distances['Kitchen'].outOfRange) {