Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save peyanski/137654685490cb5ae8ea077e14406591 to your computer and use it in GitHub Desktop.

Select an option

Save peyanski/137654685490cb5ae8ea077e14406591 to your computer and use it in GitHub Desktop.
alias: Check if tomorrow is workday and notify
description: "Sends evening notification about tomorrow's work status"
triggers:
- trigger: time
at: "20:00:00"
actions:
# Step 1: Check if tomorrow is a workday
- action: workday.check_date
metadata: {}
data:
check_date: "{{ (now().date() + timedelta(days=1)).isoformat() }}"
target:
entity_id: binary_sensor.workday_sensor
response_variable: result
# Step 2: Create notification based on result
- if:
- condition: template
value_template: "{{ result['binary_sensor.workday_sensor']['workday'] == true }}"
then:
- action: persistent_notification.create
metadata: {}
data:
message: Tomorrow is a workday. Don't forget your meeting!
title: Work Tomorrow
else:
- action: persistent_notification.create
metadata: {}
data:
message: Tomorrow is **NOT** a workday. Enjoy!
title: Relax Tomorrow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment