Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Didgeridrew / light_color_loop.yaml
Last active February 1, 2024 04:55
HA - Script Loop Light Colors
script:
color_loop_light:
alias: Color loop light
description: ""
fields:
colors:
name: Colors
description: A list of color names to set the lights to or loop through
required: true
sequence:
@Didgeridrew
Didgeridrew / random_options.yaml
Created February 1, 2024 04:39
HA - Randomize Options from a Select
# This was just a weird idea to randomize a list of values.
# Maybe it could be used for chores or activity planning?
alias: Random Option to calendar
sequence:
- variables:
option: |-
{% set options = state_attr('input_select.colors_warm', 'options')%}
{% set ns = namespace(x = options) %}
{% for i in range(ns.x|length- 1, 0, -1) %}
@Didgeridrew
Didgeridrew / nested_logical_con.yaml
Created February 1, 2024 04:29
HA - Demostrating Nested Logical Conditions
alias: Nested logical conditions
sequence:
- choose:
- alias: This works
conditions:
- condition: not
conditions:
- condition: template
value_template: false
sequence:
@Didgeridrew
Didgeridrew / process_tags.yaml
Created February 1, 2024 04:28
HA - Script to Process NFC Tag values
alias: Process Tags
fields:
reader:
description: The value read from a tag
example: "0123456789"
default: "0123456789"
sequence:
- variables:
tags:
"1234567890":
@Didgeridrew
Didgeridrew / cal_to_shopping.yaml
Created February 1, 2024 04:04
HA - Iterate over calendar events and add to Shopping list
alias: Calendar Events to Shopping List items
sequence:
- service: calendar.get_events
data:
duration:
hours: 24
minutes: 0
seconds: 0
target:
entity_id: calendar.home_assistant_events
@Didgeridrew
Didgeridrew / cal_to_todo.yaml
Created February 1, 2024 02:50
HA - Script Calendar Event to ToDo
alias: Calendar to ToDo
sequence:
- service: calendar.get_events
metadata: {}
data:
start_date_time: "{{ today_at() + timedelta(days=1) }}"
duration:
hours: 36
target:
entity_id: calendar.trash_night
@Didgeridrew
Didgeridrew / gcal_notification_relay.yaml
Created February 1, 2024 02:17
HA- Relay Google Calendar Notifications via Mobile App to HA
alias: Google Calendar Notification Relay
description: ""
trigger:
- platform: state
entity_id:
- sensor.b130dl_last_notification
condition:
- condition: state
entity_id: sensor.b130dl_last_notification
attribute: package
@Didgeridrew
Didgeridrew / button_game.yaml
Created February 1, 2024 02:12
HA - Button Game automation
alias: Button game
description: ""
trigger:
- platform: state
entity_id:
- input_button.ztest_button_1
condition: []
action:
- choose:
- conditions:
@Didgeridrew
Didgeridrew / trigger_contexts.yaml
Created February 1, 2024 02:09
HA - Trigger Contexts Template Example
alias: zTest Context Templates
description: ""
trigger:
- platform: state
entity_id:
- switch.kitchen_lightswitch
to: "on"
variables:
id: "{{trigger.to_state.context.id}}"
parent: "{{ trigger.to_state.context.parent_id }}"
@Didgeridrew
Didgeridrew / assist_scheduler.yaml
Last active December 24, 2024 16:32
HA - Assist Event Scheduler: Use dashboard card to schedule one-time home automation actions via formatted calendar event.
#----------------------- PRE-REQUISITES -------------------------
# You will need to install the following custom cards to use the include card configuration:
# - Text-input-row Card (https://github.com/gadgetchnnel/lovelace-text-input-row)
# - Custom Button Card (https://github.com/custom-cards/button-card)
# - Custom Stack-In-Card (https://github.com/custom-cards/stack-in-card)
#
# You will need to create the following helpers:
# - input_datetime.scheduled_action
# - input_text.scheduled_action_message
#