Skip to content

Instantly share code, notes, and snippets.

@yonatanp
Created February 3, 2026 01:23
Show Gist options
  • Select an option

  • Save yonatanp/65a198770398f2577ebd7e81ed8bf998 to your computer and use it in GitHub Desktop.

Select an option

Save yonatanp/65a198770398f2577ebd7e81ed8bf998 to your computer and use it in GitHub Desktop.
alias: Nightly Measurements
description: ""
triggers:
- at: "07:00:00"
id: morning_trigger
trigger: time
- at: "23:00:00"
id: write_to_file
trigger: time
- at: "00:00:00"
id: reset
trigger: time
- event_type: mobile_app_notification_action
event_data:
action: CATS_QUIET
id: cats_quiet
trigger: event
- event_type: mobile_app_notification_action
event_data:
action: CATS_NOISY
id: cats_noisy
trigger: event
- event_type: mobile_app_notification_action
event_data:
action: CATS_ROUSE
id: cats_rouse
trigger: event
- event_type: mobile_app_notification_action
event_data:
action: AGI_GOOD
id: AGI_good
trigger: event
- event_type: mobile_app_notification_action
event_data:
action: AGI_FAIR
id: agi_fair
trigger: event
- event_type: mobile_app_notification_action
event_data:
action: AGI_POOR
id: agi_poor
trigger: event
actions:
- choose:
- conditions:
- condition: trigger
id: morning_trigger
sequence:
- variables:
alarm_on: "{{ is_state('input_boolean.alarm_clock_should_alarm', 'on') }}"
- if:
- condition: template
value_template: "{{ not alarm_on }}"
then:
- wait_for_trigger:
- at: "00:09:00"
trigger: time
timeout:
hours: 2
minutes: 15
- data:
title: Cats Last Night
message: How were the cats?
data:
url: /lovelace-main/dev
actions:
- action: CATS_QUIET
title: Quiet
- action: CATS_NOISY
title: Noisy
- action: CATS_ROUSE
title: Rouse
action: notify.mobile_app_iphone
- data:
title: AGI Last Night
message: How was AGI?
data:
url: /lovelace-main/dev
actions:
- action: AGI_GOOD
title: Good
- action: AGI_FAIR
title: Fair
- action: AGI_POOR
title: Poor
action: notify.mobile_app_iphone
- conditions:
- condition: trigger
id: write_to_file
sequence:
- action: notify.send_message
data:
entity_id: notify.analytics_nightly
message: >
{"date": "{{ now().strftime('%Y-%m-%d') }}", "cats": "{{
states('input_select.nightly_cats') }}", "gi": "{{
states('input_select.nightly_agi') }}", "timestamp": "{{
now().isoformat() }}"}
- conditions:
- condition: trigger
id: reset
sequence:
- target:
entity_id:
- input_select.nightly_cats
- input_select.nightly_agi
data:
option: Unknown
action: input_select.select_option
- conditions:
- condition: trigger
id: cats_quiet
sequence:
- target:
entity_id: input_select.nightly_cats
data:
option: Quiet
action: input_select.select_option
- conditions:
- condition: trigger
id: cats_noisy
sequence:
- target:
entity_id: input_select.nightly_cats
data:
option: Noisy
action: input_select.select_option
- conditions:
- condition: trigger
id: cats_rouse
sequence:
- target:
entity_id: input_select.nightly_cats
data:
option: Rouse
action: input_select.select_option
- conditions:
- condition: trigger
id: agi_good
sequence:
- target:
entity_id: input_select.nightly_agi
data:
option: Good
action: input_select.select_option
- conditions:
- condition: trigger
id: agi_fair
sequence:
- target:
entity_id: input_select.nightly_agi
data:
option: Fair
action: input_select.select_option
- conditions:
- condition: trigger
id: agi_poor
sequence:
- target:
entity_id: input_select.nightly_agi
data:
option: Poor
action: input_select.select_option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment