Skip to content

Instantly share code, notes, and snippets.

@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
#
@Didgeridrew
Didgeridrew / added_todo.yaml
Created January 28, 2024 02:31
HA - When item added to ToDo list, send item in notification
alias: Notify recently added todo
description: ""
trigger:
- platform: state
entity_id:
- todo.chores
condition:
- condition: template
value_template: "{{ trigger.to_state.state|int > trigger.from_state.state|int }}"
action:
@Didgeridrew
Didgeridrew / cat_feeder_Sched.yaml
Created November 15, 2023 02:03
HA - Use templated attribute dictionary for time trigger
template:
- sensor:
- name: Cat Schedule
state: '{{ now() }}'
attributes:
cat_sched: |
{{ { "07:00": 3,
"11:00": 1,
"15:00": 2,
"21:00": 2,