Skip to content

Instantly share code, notes, and snippets.

View piitaya's full-sized avatar

Paul Bottein piitaya

View GitHub Profile
blueprint:
name: Cinema light brightness
description: Adjust light brightness when media is playing/paused/stopped
domain: automation
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
input:
media_player_entity:
name: Media Player
selector:
entity:
mqtt:
climate:
- name: Intex Spa Heater
icon: mdi:fire
unique_id: mqtt_intex_spa_heater
availability:
- topic: "intex/state"
payload_available: "online"
payload_not_available: "offline"
value_template: >-
media_player:
- platform: smartthings_soundbar
name: Soundbar
api_key: !secret samsung_soundbar_api_key
device_id: !secret samsung_soundbar_device_id
max_volume: 20
homeassistant:
customize:
media_player.soundbar:
@piitaya
piitaya / assist_calendar.yaml
Last active October 3, 2024 09:01
Assist Calendar Blueprint
blueprint:
name: Assist Calendar
author: Piitaya
description: Use Assist and a calendar to schedule actions in natural language.
domain: automation
input:
calendar:
name: Calendar
description: All events in this calendar will be processed by Assist
selector:
@piitaya
piitaya / sun_protection_shutter.yaml
Last active October 3, 2024 09:00
Sun protection for shutter
blueprint:
name: Protection du soleil
author: Piitaya
description: Règle le volet en fonction de la position du soleil.
source_url: https://gist.github.com/piitaya/3ef9de56183dcdcfd4fb38c51c8a4f04
domain: automation
input:
shutter:
name: Volet
description: Volet à contrôler
blueprint:
name: Home Assistant Auto-update
description: Auto-update Home Assistant when a new update is available
domain: automation
author: Piitaya
source_url: https://gist.github.com/piitaya/7ee4e6e6431775a065bc08d2d2839ff4
input:
core_entity:
name: Core
description: Core update entity
@piitaya
piitaya / sun_exposition.jinja
Last active August 12, 2024 09:43
Sun exposition macro
{% macro is_exposed(orientation) %}
{% set is_sunrise = as_timestamp(now()) < as_timestamp(today_at("12:00")) %}
{% set azimuth = states('sensor.sun_solar_azimuth') | float(0) %}
{% set elevation = states('sensor.sun_solar_elevation') | float(0) %}
{% set max_sun_angle = states('input_number.shutter_max_sun_angle') | float(0) %}
{% if is_sunrise %}
{% set min_sun_elevation = states('input_number.shutter_min_sun_elevation_sunrise') | float(0) %}
{% else %}
{% set min_sun_elevation = states('input_number.shutter_min_sun_elevation_sunset') | float(0) %}
{% endif %}