Refactor chore tracker for new kids: Emma, Liam, and Zoe
- Updated dashboard YAML to reflect new kids and their chores. - Modified chores configuration to include new kids with appropriate icons and settings. - Adjusted generation script to handle new MDI glyphs for icons. - Revised Home Assistant integration to support new kids, including input buttons and automation for chores. - Ensured all references to old kids (Jordyn, Declan, Chloe) are replaced with new names and corresponding logic.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
# chore-tracker-dashboard.yaml (AUTO-GENERATED — edit chores_config.yaml)
|
# chore-tracker-dashboard.yaml (AUTO-GENERATED — edit chores_config.yaml)
|
||||||
# Kids: Jordyn, Declan, Chloe
|
# Kids: Emma, Liam, Zoe
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
title: "Chore Tracker"
|
title: "Chore Tracker"
|
||||||
@@ -13,26 +13,26 @@ views:
|
|||||||
cards:
|
cards:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
content: >
|
content: >
|
||||||
### 😺 Jordyn
|
### Emma
|
||||||
{{
|
{{
|
||||||
'All done!' if states('sensor.jordyn_all_chores_done') == 'True'
|
'All done!' if states('sensor.emma_all_chores_done') == 'True'
|
||||||
else states('sensor.jordyn_chores_done_today') ~ '/5 chores done'
|
else states('sensor.emma_chores_done_today') ~ '/5 chores done'
|
||||||
}}
|
}}
|
||||||
|
|
||||||
- type: markdown
|
- type: markdown
|
||||||
content: >
|
content: >
|
||||||
### 🤓 Declan
|
### Liam
|
||||||
{{
|
{{
|
||||||
'All done!' if states('sensor.declan_all_chores_done') == 'True'
|
'All done!' if states('sensor.liam_all_chores_done') == 'True'
|
||||||
else states('sensor.declan_chores_done_today') ~ '/4 chores done'
|
else states('sensor.liam_chores_done_today') ~ '/4 chores done'
|
||||||
}}
|
}}
|
||||||
|
|
||||||
- type: markdown
|
- type: markdown
|
||||||
content: >
|
content: >
|
||||||
### 🌝 Chloe
|
### Zoe
|
||||||
{{
|
{{
|
||||||
'All done!' if states('sensor.chloe_all_chores_done') == 'True'
|
'All done!' if states('sensor.zoe_all_chores_done') == 'True'
|
||||||
else states('sensor.chloe_chores_done_today') ~ '/6 chores done'
|
else states('sensor.zoe_chores_done_today') ~ '/6 chores done'
|
||||||
}}
|
}}
|
||||||
|
|
||||||
- type: button
|
- type: button
|
||||||
@@ -44,90 +44,90 @@ views:
|
|||||||
target:
|
target:
|
||||||
entity_id: input_button.reset_all_chores
|
entity_id: input_button.reset_all_chores
|
||||||
- type: entities
|
- type: entities
|
||||||
title: "😺 Jordyn's Chores"
|
title: " Emma's Chores"
|
||||||
entities:
|
entities:
|
||||||
- entity: switch.chore_tracker_jordyn_make_bed
|
- entity: switch.chore_tracker_emma_make_bed
|
||||||
name: "🛏️ Make Bed"
|
name: " Make Bed"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_jordyn_brush_teeth
|
- entity: switch.chore_tracker_emma_brush_teeth
|
||||||
name: "🦷 Brush Teeth"
|
name: " Brush Teeth"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_jordyn_tidy_room
|
- entity: switch.chore_tracker_emma_tidy_room
|
||||||
name: "🧹 Tidy Room"
|
name: " Tidy Room"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_jordyn_homework
|
- entity: switch.chore_tracker_emma_homework
|
||||||
name: "📚 Homework"
|
name: " Homework"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_jordyn_feed_dog
|
- entity: switch.chore_tracker_emma_feed_dog
|
||||||
name: "🐾 Feed Dog"
|
name: " Feed Dog"
|
||||||
- type: divider
|
- type: divider
|
||||||
- entity: sensor.jordyn_chores_done_today
|
- entity: sensor.emma_chores_done_today
|
||||||
name: "Chores done today"
|
name: "Chores done today"
|
||||||
- entity: sensor.jordyn_all_chores_done
|
- entity: sensor.emma_all_chores_done
|
||||||
name: "All Done?"
|
name: "All Done?"
|
||||||
- type: button
|
- type: button
|
||||||
name: "Reset Jordyn's Chores"
|
name: "Reset Emma's Chores"
|
||||||
tap_action:
|
tap_action:
|
||||||
action: call-service
|
action: call-service
|
||||||
service: input_button.press
|
service: input_button.press
|
||||||
target:
|
target:
|
||||||
entity_id: input_button.jordyn_reset_chores
|
entity_id: input_button.emma_reset_chores
|
||||||
- type: entities
|
- type: entities
|
||||||
title: "🤓 Declan's Chores"
|
title: " Liam's Chores"
|
||||||
entities:
|
entities:
|
||||||
- entity: switch.chore_tracker_declan_make_bed
|
- entity: switch.chore_tracker_liam_make_bed
|
||||||
name: "🛏️ Make Bed"
|
name: " Make Bed"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_declan_brush_teeth
|
- entity: switch.chore_tracker_liam_brush_teeth
|
||||||
name: "🦷 Brush Teeth"
|
name: " Brush Teeth"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_declan_set_table
|
- entity: switch.chore_tracker_liam_set_table
|
||||||
name: "🍽️ Set Table"
|
name: " Set Table"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_declan_take_out_trash
|
- entity: switch.chore_tracker_liam_take_out_trash
|
||||||
name: "🗑️ Take Out Trash"
|
name: " Take Out Trash"
|
||||||
- type: divider
|
- type: divider
|
||||||
- entity: sensor.declan_chores_done_today
|
- entity: sensor.liam_chores_done_today
|
||||||
name: "Chores done today"
|
name: "Chores done today"
|
||||||
- entity: sensor.declan_all_chores_done
|
- entity: sensor.liam_all_chores_done
|
||||||
name: "All Done?"
|
name: "All Done?"
|
||||||
- type: button
|
- type: button
|
||||||
name: "Reset Declan's Chores"
|
name: "Reset Liam's Chores"
|
||||||
tap_action:
|
tap_action:
|
||||||
action: call-service
|
action: call-service
|
||||||
service: input_button.press
|
service: input_button.press
|
||||||
target:
|
target:
|
||||||
entity_id: input_button.declan_reset_chores
|
entity_id: input_button.liam_reset_chores
|
||||||
- type: entities
|
- type: entities
|
||||||
title: "🌝 Chloe's Chores"
|
title: " Zoe's Chores"
|
||||||
entities:
|
entities:
|
||||||
- entity: switch.chore_tracker_chloe_make_bed
|
- entity: switch.chore_tracker_zoe_make_bed
|
||||||
name: "🛏️ Make Bed"
|
name: " Make Bed"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_chloe_brush_teeth
|
- entity: switch.chore_tracker_zoe_brush_teeth
|
||||||
name: "🦷 Brush Teeth"
|
name: " Brush Teeth"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_chloe_water_plants
|
- entity: switch.chore_tracker_zoe_water_plants
|
||||||
name: "🌱 Water Plants"
|
name: " Water Plants"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_chloe_homework
|
- entity: switch.chore_tracker_zoe_homework
|
||||||
name: "📚 Homework"
|
name: " Homework"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_chloe_tidy_room
|
- entity: switch.chore_tracker_zoe_tidy_room
|
||||||
name: "🧹 Tidy Room"
|
name: " Tidy Room"
|
||||||
|
|
||||||
- entity: switch.chore_tracker_chloe_practice_piano
|
- entity: switch.chore_tracker_zoe_practice_piano
|
||||||
name: "🎹 Practice Piano"
|
name: " Practice Piano"
|
||||||
- type: divider
|
- type: divider
|
||||||
- entity: sensor.chloe_chores_done_today
|
- entity: sensor.zoe_chores_done_today
|
||||||
name: "Chores done today"
|
name: "Chores done today"
|
||||||
- entity: sensor.chloe_all_chores_done
|
- entity: sensor.zoe_all_chores_done
|
||||||
name: "All Done?"
|
name: "All Done?"
|
||||||
- type: button
|
- type: button
|
||||||
name: "Reset Chloe's Chores"
|
name: "Reset Zoe's Chores"
|
||||||
tap_action:
|
tap_action:
|
||||||
action: call-service
|
action: call-service
|
||||||
service: input_button.press
|
service: input_button.press
|
||||||
target:
|
target:
|
||||||
entity_id: input_button.chloe_reset_chores
|
entity_id: input_button.zoe_reset_chores
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,30 @@
|
|||||||
#
|
#
|
||||||
# Edit this file to change kids, chores, and settings.
|
# Edit this file to change kids, chores, and settings.
|
||||||
# Then run: python3 generate.py
|
# Then run: python3 generate.py
|
||||||
|
#
|
||||||
|
# ICONS: Use MDI codepoints from https://pictogrammers.com/library/mdi/
|
||||||
|
# Format: "\U000FXXXX" e.g. mdi:bed = "\U000F02E3"
|
||||||
|
# The kid avatar field also uses MDI codepoints.
|
||||||
|
#
|
||||||
|
# Common chore icons:
|
||||||
|
# Bed: "\U000F02E3" mdi:bed
|
||||||
|
# Brush teeth: "\U000F09A9" mdi:toothbrush
|
||||||
|
# Broom: "\U000F00A8" mdi:broom
|
||||||
|
# Book: "\U000F0219" mdi:book-open-variant
|
||||||
|
# Dog: "\U000F01F9" mdi:dog
|
||||||
|
# Paw: "\U000F0265" mdi:paw
|
||||||
|
# Silverware: "\U000F03E7" mdi:silverware-fork-knife
|
||||||
|
# Trash: "\U000F05B8" mdi:trash-can
|
||||||
|
# Watering can: "\U000F1B25" mdi:watering-can
|
||||||
|
# Piano: "\U000F0F9E" mdi:piano
|
||||||
|
# Dumbbell: "\U000F0F1E" mdi:dumbbell
|
||||||
|
# Shower: "\U000F0467" mdi:shower
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
settings:
|
settings:
|
||||||
device_name: chore-tracker
|
device_name: chore-tracker
|
||||||
friendly_name: "Chore Tracker"
|
friendly_name: "Chore Tracker"
|
||||||
wifi_ssid: !secret wifi_iot_ssid
|
wifi_ssid: !secret wifi_ssid
|
||||||
wifi_password: !secret wifi_password
|
wifi_password: !secret wifi_password
|
||||||
api_key: !secret api_encryption_key
|
api_key: !secret api_encryption_key
|
||||||
ota_password: !secret ota_password
|
ota_password: !secret ota_password
|
||||||
@@ -17,54 +35,54 @@ settings:
|
|||||||
notify_service: notify.notify
|
notify_service: notify.notify
|
||||||
|
|
||||||
# ── KIDS ──────────────────────────────────────────────────────────────────────
|
# ── KIDS ──────────────────────────────────────────────────────────────────────
|
||||||
# Each kid has their own chore list.
|
# avatar: MDI codepoint shown in the sidebar on the kid's chore page
|
||||||
# name, avatar, color, color_dark, and chores are all required.
|
# color / color_dark: hex colours for that kid's sidebar
|
||||||
#
|
#
|
||||||
kids:
|
kids:
|
||||||
- name: Jordyn
|
- name: Emma
|
||||||
avatar: "😺"
|
avatar: "\U000F01F9" # mdi:dog
|
||||||
color: "4D96FF"
|
color: "4D96FF"
|
||||||
color_dark: "2A6FCC"
|
color_dark: "2A6FCC"
|
||||||
chores:
|
chores:
|
||||||
- name: Make Bed
|
- name: Make Bed
|
||||||
icon: "🛏️"
|
icon: "\U000F02E3" # mdi:bed
|
||||||
- name: Brush Teeth
|
- name: Brush Teeth
|
||||||
icon: "🦷"
|
icon: "\U000F09A9" # mdi:toothbrush
|
||||||
- name: Tidy Room
|
- name: Tidy Room
|
||||||
icon: "🧹"
|
icon: "\U000F00A8" # mdi:broom
|
||||||
- name: Homework
|
- name: Homework
|
||||||
icon: "📚"
|
icon: "\U000F0219" # mdi:book-open-variant
|
||||||
- name: Feed Dog
|
- name: Feed Dog
|
||||||
icon: "🐾"
|
icon: "\U000F0265" # mdi:paw
|
||||||
|
|
||||||
- name: Declan
|
- name: Liam
|
||||||
avatar: "🤓"
|
avatar: "\U000F0C99" # mdi:cat
|
||||||
color: "C77DFF"
|
color: "C77DFF"
|
||||||
color_dark: "8B42CC"
|
color_dark: "8B42CC"
|
||||||
chores:
|
chores:
|
||||||
- name: Make Bed
|
- name: Make Bed
|
||||||
icon: "🛏️"
|
icon: "\U000F02E3" # mdi:bed
|
||||||
- name: Brush Teeth
|
- name: Brush Teeth
|
||||||
icon: "🦷"
|
icon: "\U000F09A9" # mdi:toothbrush
|
||||||
- name: Set Table
|
- name: Set Table
|
||||||
icon: "🍽️"
|
icon: "\U000F03E7" # mdi:silverware-fork-knife
|
||||||
- name: Take Out Trash
|
- name: Take Out Trash
|
||||||
icon: "🗑️"
|
icon: "\U000F05B8" # mdi:trash-can
|
||||||
|
|
||||||
- name: Chloe
|
- name: Zoe
|
||||||
avatar: "🌝"
|
avatar: "\U000F17B5" # mdi:teddy-bear
|
||||||
color: "FF6B9D"
|
color: "FF6B9D"
|
||||||
color_dark: "CC3A6F"
|
color_dark: "CC3A6F"
|
||||||
chores:
|
chores:
|
||||||
- name: Make Bed
|
- name: Make Bed
|
||||||
icon: "🛏️"
|
icon: "\U000F02E3" # mdi:bed
|
||||||
- name: Brush Teeth
|
- name: Brush Teeth
|
||||||
icon: "🦷"
|
icon: "\U000F09A9" # mdi:toothbrush
|
||||||
- name: Water Plants
|
- name: Water Plants
|
||||||
icon: "🌱"
|
icon: "\U000F1B25" # mdi:watering-can
|
||||||
- name: Homework
|
- name: Homework
|
||||||
icon: "📚"
|
icon: "\U000F0219" # mdi:book-open-variant
|
||||||
- name: Tidy Room
|
- name: Tidy Room
|
||||||
icon: "🧹"
|
icon: "\U000F00A8" # mdi:broom
|
||||||
- name: Practice Piano
|
- name: Practice Piano
|
||||||
icon: "🎹"
|
icon: "\U000F0F9E" # mdi:piano
|
||||||
@@ -122,6 +122,13 @@ def gen_esphome(cfg: dict) -> str:
|
|||||||
lvgl_pages = _gen_lvgl_pages(kids)
|
lvgl_pages = _gen_lvgl_pages(kids)
|
||||||
scripts = _gen_scripts(kids)
|
scripts = _gen_scripts(kids)
|
||||||
|
|
||||||
|
# Collect all unique MDI glyphs used (avatars + chore icons)
|
||||||
|
all_glyphs = sorted(set(
|
||||||
|
[k["avatar"] for k in kids] +
|
||||||
|
[c["icon"] for k in kids for c in get_chores(k)]
|
||||||
|
))
|
||||||
|
glyphs_str = "".join(all_glyphs)
|
||||||
|
|
||||||
return f"""\
|
return f"""\
|
||||||
################################################################################
|
################################################################################
|
||||||
# chore-tracker-esphome.yaml (AUTO-GENERATED — edit chores_config.yaml)
|
# chore-tracker-esphome.yaml (AUTO-GENERATED — edit chores_config.yaml)
|
||||||
@@ -255,6 +262,17 @@ font:
|
|||||||
- file: "fonts/Nunito-SemiBold.ttf"
|
- file: "fonts/Nunito-SemiBold.ttf"
|
||||||
id: font_tiny
|
id: font_tiny
|
||||||
size: 13
|
size: 13
|
||||||
|
# MDI icon font — used for chore icons and kid avatars
|
||||||
|
- file: "fonts/materialdesignicons-webfont.ttf"
|
||||||
|
id: font_mdi_large
|
||||||
|
size: 48
|
||||||
|
bpp: 4
|
||||||
|
glyphs: {glyphs_str}
|
||||||
|
- file: "fonts/materialdesignicons-webfont.ttf"
|
||||||
|
id: font_mdi_small
|
||||||
|
size: 32
|
||||||
|
bpp: 4
|
||||||
|
glyphs: {glyphs_str}
|
||||||
|
|
||||||
# ── Switches — backlight raw + one per chore per kid ─────────────────────────
|
# ── Switches — backlight raw + one per chore per kid ─────────────────────────
|
||||||
switch:
|
switch:
|
||||||
@@ -336,7 +354,7 @@ def _gen_lvgl_pages(kids: list) -> str:
|
|||||||
align: CENTER
|
align: CENTER
|
||||||
y: -45
|
y: -45
|
||||||
text: "{kid['avatar']}"
|
text: "{kid['avatar']}"
|
||||||
text_font: font_title
|
text_font: font_mdi_large
|
||||||
- label:
|
- label:
|
||||||
align: CENTER
|
align: CENTER
|
||||||
y: 22
|
y: 22
|
||||||
@@ -443,7 +461,7 @@ def _gen_lvgl_pages(kids: list) -> str:
|
|||||||
align: CENTER
|
align: CENTER
|
||||||
y: {icon_y}
|
y: {icon_y}
|
||||||
text: "{chore['icon']}"
|
text: "{chore['icon']}"
|
||||||
text_font: font_med
|
text_font: font_mdi_small
|
||||||
- label:
|
- label:
|
||||||
align: CENTER
|
align: CENTER
|
||||||
y: {label_y}
|
y: {label_y}
|
||||||
@@ -475,7 +493,7 @@ def _gen_lvgl_pages(kids: list) -> str:
|
|||||||
width: {sidebar_w}
|
width: {sidebar_w}
|
||||||
align: TOP_MID
|
align: TOP_MID
|
||||||
text: "{kid['avatar']}"
|
text: "{kid['avatar']}"
|
||||||
text_font: font_title
|
text_font: font_mdi_large
|
||||||
- label:
|
- label:
|
||||||
x: 0
|
x: 0
|
||||||
y: 76
|
y: 76
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
# chore-tracker-ha.yaml (AUTO-GENERATED — edit chores_config.yaml)
|
# chore-tracker-ha.yaml (AUTO-GENERATED — edit chores_config.yaml)
|
||||||
# Kids: Jordyn, Declan, Chloe
|
# Kids: Emma, Liam, Zoe
|
||||||
#
|
#
|
||||||
# BIDIRECTIONAL SYNC:
|
# BIDIRECTIONAL SYNC:
|
||||||
# Screen to HA: Each switch calls homeassistant.service on toggle
|
# Screen to HA: Each switch calls homeassistant.service on toggle
|
||||||
@@ -8,14 +8,14 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
input_button:
|
input_button:
|
||||||
jordyn_reset_chores:
|
emma_reset_chores:
|
||||||
name: "Reset Jordyn's Chores"
|
name: "Reset Emma's Chores"
|
||||||
icon: mdi:restart
|
icon: mdi:restart
|
||||||
declan_reset_chores:
|
liam_reset_chores:
|
||||||
name: "Reset Declan's Chores"
|
name: "Reset Liam's Chores"
|
||||||
icon: mdi:restart
|
icon: mdi:restart
|
||||||
chloe_reset_chores:
|
zoe_reset_chores:
|
||||||
name: "Reset Chloe's Chores"
|
name: "Reset Zoe's Chores"
|
||||||
icon: mdi:restart
|
icon: mdi:restart
|
||||||
reset_all_chores:
|
reset_all_chores:
|
||||||
name: "Reset All Chores"
|
name: "Reset All Chores"
|
||||||
@@ -23,112 +23,112 @@ input_button:
|
|||||||
|
|
||||||
template:
|
template:
|
||||||
- sensor:
|
- sensor:
|
||||||
- name: "Jordyn Chores Done Today"
|
- name: "Emma Chores Done Today"
|
||||||
unique_id: jordyn_chores_done_today
|
unique_id: emma_chores_done_today
|
||||||
icon: mdi:check-circle
|
icon: mdi:check-circle
|
||||||
state: >
|
state: >
|
||||||
{% set chores = [states('switch.chore_tracker_jordyn_make_bed'), states('switch.chore_tracker_jordyn_brush_teeth'), states('switch.chore_tracker_jordyn_tidy_room'), states('switch.chore_tracker_jordyn_homework'), states('switch.chore_tracker_jordyn_feed_dog')] %}
|
{% set chores = [states('switch.chore_tracker_emma_make_bed'), states('switch.chore_tracker_emma_brush_teeth'), states('switch.chore_tracker_emma_tidy_room'), states('switch.chore_tracker_emma_homework'), states('switch.chore_tracker_emma_feed_dog')] %}
|
||||||
{{ chores | select('equalto', 'on') | list | count }}
|
{{ chores | select('equalto', 'on') | list | count }}
|
||||||
|
|
||||||
- name: "Jordyn All Chores Done"
|
- name: "Emma All Chores Done"
|
||||||
unique_id: jordyn_all_chores_done
|
unique_id: emma_all_chores_done
|
||||||
icon: mdi:check-all
|
icon: mdi:check-all
|
||||||
state: >
|
state: >
|
||||||
{{ states('sensor.jordyn_chores_done_today') | int == 5 }}
|
{{ states('sensor.emma_chores_done_today') | int == 5 }}
|
||||||
|
|
||||||
- name: "Declan Chores Done Today"
|
- name: "Liam Chores Done Today"
|
||||||
unique_id: declan_chores_done_today
|
unique_id: liam_chores_done_today
|
||||||
icon: mdi:check-circle
|
icon: mdi:check-circle
|
||||||
state: >
|
state: >
|
||||||
{% set chores = [states('switch.chore_tracker_declan_make_bed'), states('switch.chore_tracker_declan_brush_teeth'), states('switch.chore_tracker_declan_set_table'), states('switch.chore_tracker_declan_take_out_trash')] %}
|
{% set chores = [states('switch.chore_tracker_liam_make_bed'), states('switch.chore_tracker_liam_brush_teeth'), states('switch.chore_tracker_liam_set_table'), states('switch.chore_tracker_liam_take_out_trash')] %}
|
||||||
{{ chores | select('equalto', 'on') | list | count }}
|
{{ chores | select('equalto', 'on') | list | count }}
|
||||||
|
|
||||||
- name: "Declan All Chores Done"
|
- name: "Liam All Chores Done"
|
||||||
unique_id: declan_all_chores_done
|
unique_id: liam_all_chores_done
|
||||||
icon: mdi:check-all
|
icon: mdi:check-all
|
||||||
state: >
|
state: >
|
||||||
{{ states('sensor.declan_chores_done_today') | int == 4 }}
|
{{ states('sensor.liam_chores_done_today') | int == 4 }}
|
||||||
|
|
||||||
- name: "Chloe Chores Done Today"
|
- name: "Zoe Chores Done Today"
|
||||||
unique_id: chloe_chores_done_today
|
unique_id: zoe_chores_done_today
|
||||||
icon: mdi:check-circle
|
icon: mdi:check-circle
|
||||||
state: >
|
state: >
|
||||||
{% set chores = [states('switch.chore_tracker_chloe_make_bed'), states('switch.chore_tracker_chloe_brush_teeth'), states('switch.chore_tracker_chloe_water_plants'), states('switch.chore_tracker_chloe_homework'), states('switch.chore_tracker_chloe_tidy_room'), states('switch.chore_tracker_chloe_practice_piano')] %}
|
{% set chores = [states('switch.chore_tracker_zoe_make_bed'), states('switch.chore_tracker_zoe_brush_teeth'), states('switch.chore_tracker_zoe_water_plants'), states('switch.chore_tracker_zoe_homework'), states('switch.chore_tracker_zoe_tidy_room'), states('switch.chore_tracker_zoe_practice_piano')] %}
|
||||||
{{ chores | select('equalto', 'on') | list | count }}
|
{{ chores | select('equalto', 'on') | list | count }}
|
||||||
|
|
||||||
- name: "Chloe All Chores Done"
|
- name: "Zoe All Chores Done"
|
||||||
unique_id: chloe_all_chores_done
|
unique_id: zoe_all_chores_done
|
||||||
icon: mdi:check-all
|
icon: mdi:check-all
|
||||||
state: >
|
state: >
|
||||||
{{ states('sensor.chloe_chores_done_today') | int == 6 }}
|
{{ states('sensor.zoe_chores_done_today') | int == 6 }}
|
||||||
|
|
||||||
|
|
||||||
automation:
|
automation:
|
||||||
- id: jordyn_reset_from_ha
|
- id: emma_reset_from_ha
|
||||||
alias: "Chore Tracker - Reset Jordyn's chores from HA"
|
alias: "Chore Tracker - Reset Emma's chores from HA"
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_button.jordyn_reset_chores
|
entity_id: input_button.emma_reset_chores
|
||||||
action:
|
action:
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_make_bed
|
entity_id: switch.chore_tracker_emma_make_bed
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_brush_teeth
|
entity_id: switch.chore_tracker_emma_brush_teeth
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_tidy_room
|
entity_id: switch.chore_tracker_emma_tidy_room
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_homework
|
entity_id: switch.chore_tracker_emma_homework
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_feed_dog
|
entity_id: switch.chore_tracker_emma_feed_dog
|
||||||
|
|
||||||
- id: declan_reset_from_ha
|
- id: liam_reset_from_ha
|
||||||
alias: "Chore Tracker - Reset Declan's chores from HA"
|
alias: "Chore Tracker - Reset Liam's chores from HA"
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_button.declan_reset_chores
|
entity_id: input_button.liam_reset_chores
|
||||||
action:
|
action:
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_declan_make_bed
|
entity_id: switch.chore_tracker_liam_make_bed
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_declan_brush_teeth
|
entity_id: switch.chore_tracker_liam_brush_teeth
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_declan_set_table
|
entity_id: switch.chore_tracker_liam_set_table
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_declan_take_out_trash
|
entity_id: switch.chore_tracker_liam_take_out_trash
|
||||||
|
|
||||||
- id: chloe_reset_from_ha
|
- id: zoe_reset_from_ha
|
||||||
alias: "Chore Tracker - Reset Chloe's chores from HA"
|
alias: "Chore Tracker - Reset Zoe's chores from HA"
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_button.chloe_reset_chores
|
entity_id: input_button.zoe_reset_chores
|
||||||
action:
|
action:
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_make_bed
|
entity_id: switch.chore_tracker_zoe_make_bed
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_brush_teeth
|
entity_id: switch.chore_tracker_zoe_brush_teeth
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_water_plants
|
entity_id: switch.chore_tracker_zoe_water_plants
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_homework
|
entity_id: switch.chore_tracker_zoe_homework
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_tidy_room
|
entity_id: switch.chore_tracker_zoe_tidy_room
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_practice_piano
|
entity_id: switch.chore_tracker_zoe_practice_piano
|
||||||
|
|
||||||
- id: reset_all_from_ha
|
- id: reset_all_from_ha
|
||||||
alias: "Chore Tracker - Reset ALL chores from HA"
|
alias: "Chore Tracker - Reset ALL chores from HA"
|
||||||
@@ -138,85 +138,85 @@ automation:
|
|||||||
action:
|
action:
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_make_bed
|
entity_id: switch.chore_tracker_emma_make_bed
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_brush_teeth
|
entity_id: switch.chore_tracker_emma_brush_teeth
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_tidy_room
|
entity_id: switch.chore_tracker_emma_tidy_room
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_homework
|
entity_id: switch.chore_tracker_emma_homework
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_jordyn_feed_dog
|
entity_id: switch.chore_tracker_emma_feed_dog
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_declan_make_bed
|
entity_id: switch.chore_tracker_liam_make_bed
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_declan_brush_teeth
|
entity_id: switch.chore_tracker_liam_brush_teeth
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_declan_set_table
|
entity_id: switch.chore_tracker_liam_set_table
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_declan_take_out_trash
|
entity_id: switch.chore_tracker_liam_take_out_trash
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_make_bed
|
entity_id: switch.chore_tracker_zoe_make_bed
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_brush_teeth
|
entity_id: switch.chore_tracker_zoe_brush_teeth
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_water_plants
|
entity_id: switch.chore_tracker_zoe_water_plants
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_homework
|
entity_id: switch.chore_tracker_zoe_homework
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_tidy_room
|
entity_id: switch.chore_tracker_zoe_tidy_room
|
||||||
- service: switch.turn_off
|
- service: switch.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: switch.chore_tracker_chloe_practice_piano
|
entity_id: switch.chore_tracker_zoe_practice_piano
|
||||||
|
|
||||||
- id: jordyn_all_done_notify
|
- id: emma_all_done_notify
|
||||||
alias: "Chore Tracker - Jordyn all done!"
|
alias: "Chore Tracker - Emma all done!"
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.jordyn_all_chores_done
|
entity_id: sensor.emma_all_chores_done
|
||||||
to: "True"
|
to: "True"
|
||||||
action:
|
action:
|
||||||
- service: notify.notify
|
- service: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "Jordyn finished all chores!"
|
title: "Emma finished all chores!"
|
||||||
message: "Jordyn completed all 5 chores today!"
|
message: "Emma completed all 5 chores today!"
|
||||||
|
|
||||||
- id: declan_all_done_notify
|
- id: liam_all_done_notify
|
||||||
alias: "Chore Tracker - Declan all done!"
|
alias: "Chore Tracker - Liam all done!"
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.declan_all_chores_done
|
entity_id: sensor.liam_all_chores_done
|
||||||
to: "True"
|
to: "True"
|
||||||
action:
|
action:
|
||||||
- service: notify.notify
|
- service: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "Declan finished all chores!"
|
title: "Liam finished all chores!"
|
||||||
message: "Declan completed all 4 chores today!"
|
message: "Liam completed all 4 chores today!"
|
||||||
|
|
||||||
- id: chloe_all_done_notify
|
- id: zoe_all_done_notify
|
||||||
alias: "Chore Tracker - Chloe all done!"
|
alias: "Chore Tracker - Zoe all done!"
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.chloe_all_chores_done
|
entity_id: sensor.zoe_all_chores_done
|
||||||
to: "True"
|
to: "True"
|
||||||
action:
|
action:
|
||||||
- service: notify.notify
|
- service: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "Chloe finished all chores!"
|
title: "Zoe finished all chores!"
|
||||||
message: "Chloe completed all 6 chores today!"
|
message: "Zoe completed all 6 chores today!"
|
||||||
|
|
||||||
- id: chore_reminder_evening
|
- id: chore_reminder_evening
|
||||||
alias: "Chore Tracker - Evening reminder"
|
alias: "Chore Tracker - Evening reminder"
|
||||||
@@ -226,33 +226,33 @@ automation:
|
|||||||
action:
|
action:
|
||||||
- if:
|
- if:
|
||||||
condition: template
|
condition: template
|
||||||
value_template: "{{ states('sensor.jordyn_all_chores_done') != 'True' }}"
|
value_template: "{{ states('sensor.emma_all_chores_done') != 'True' }}"
|
||||||
then:
|
then:
|
||||||
- service: notify.notify
|
- service: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "Jordyn has unfinished chores"
|
title: "Emma has unfinished chores"
|
||||||
message: >
|
message: >
|
||||||
Jordyn has done
|
Emma has done
|
||||||
{{ states('sensor.jordyn_chores_done_today') }}/5 chores today.
|
{{ states('sensor.emma_chores_done_today') }}/5 chores today.
|
||||||
- if:
|
- if:
|
||||||
condition: template
|
condition: template
|
||||||
value_template: "{{ states('sensor.declan_all_chores_done') != 'True' }}"
|
value_template: "{{ states('sensor.liam_all_chores_done') != 'True' }}"
|
||||||
then:
|
then:
|
||||||
- service: notify.notify
|
- service: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "Declan has unfinished chores"
|
title: "Liam has unfinished chores"
|
||||||
message: >
|
message: >
|
||||||
Declan has done
|
Liam has done
|
||||||
{{ states('sensor.declan_chores_done_today') }}/4 chores today.
|
{{ states('sensor.liam_chores_done_today') }}/4 chores today.
|
||||||
- if:
|
- if:
|
||||||
condition: template
|
condition: template
|
||||||
value_template: "{{ states('sensor.chloe_all_chores_done') != 'True' }}"
|
value_template: "{{ states('sensor.zoe_all_chores_done') != 'True' }}"
|
||||||
then:
|
then:
|
||||||
- service: notify.notify
|
- service: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "Chloe has unfinished chores"
|
title: "Zoe has unfinished chores"
|
||||||
message: >
|
message: >
|
||||||
Chloe has done
|
Zoe has done
|
||||||
{{ states('sensor.chloe_chores_done_today') }}/6 chores today.
|
{{ states('sensor.zoe_chores_done_today') }}/6 chores today.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user