Skip to content

Instantly share code, notes, and snippets.

View filikun's full-sized avatar

Filip filikun

  • Sweden
View GitHub Profile
@filikun
filikun / gist:30c1d2be7e63366d23e6291ea43826c7
Created January 22, 2022 16:49
Motion activated lights
alias: 💡 Belysning vardagsrum rörelse
description: ''
trigger:
- platform: state
entity_id: binary_sensor.occupancy_livingroom_motion
to: 'on'
id: 'on'
- platform: state
entity_id: binary_sensor.occupancy_livingroom_motion
to: 'off'
@filikun
filikun / calendar_sensor.yaml
Created November 16, 2021 14:39
Calendar sensor
- sensor:
- name: "Next birthday"
state: >
{{ state_attr('calendar.fodelsedagar_fodelsedagar','message') |regex_replace(find='🎁 ', replace='', ignorecase=False)|truncate(35, True, '...',0) }}
attributes:
days_text: >
{% set start_time = state_attr('calendar.fodelsedagar_fodelsedagar', 'start_time') %}
{% set end_time = state_attr('calendar.fodelsedagar_fodelsedagar', 'end_time') %}
{% if start_time != None %}
{% set time = as_timestamp(start_time) | timestamp_custom('%H:%M') %}
@filikun
filikun / custom_card_filikun_calendar.yaml
Last active November 16, 2021 14:37
Calendar minimalist custom card
custom_card_filikun_calendar:
template:
- icon_info_filikun_calendar
name: "[[[ return entity.state != '' ? entity.state : entity.entity_id ]]]"
label: "[[[ return entity.attributes.days_text != '' ? entity.attributes.days_text : entity.entity_id ]]]"
icon_info_filikun_calendar:
color: var(--google-grey)
show_icon: true
show_label: true