Files
fresh-home/scripts/grocy_say_chores.yaml
T
2024-04-14 14:08:56 -04:00

91 lines
2.6 KiB
YAML

mode: parallel
alias: Grocy Say Chores
sequence:
- variables:
speaker: "{{speaker}}"
closing_line: >
{% if room is defined %}
Nothing needs to be done in the {{ room }}
{% elif person is defined %}
{{ person }} doesn't need to do anything
{% else %}
Nothing pressing needs to be done
{% endif %}
object_name: >
{% if room is defined %}
{{ (room | lower).replace(' ','_')~"_" }}
{% elif person is defined %}
{{ (person | lower).replace(' ','_')~"_" }}
{% else %}
{% endif %}
room_name: >
{% if room is defined %}
{% if room == "All" %}{%else%}{{ (room | lower).replace(' ','_')~"_" }}{%endif%}
{% endif %}
person_name: >
{% if person is defined %}
{{ (person | lower).replace(' ','_')~"_" }}
{% endif %}
- alias: "Say next three chores"
service: tts.google_translate_say
data:
entity_id: "{{speaker}}"
message: >-
{% if not is_state('sensor.'~object_name~'chore_one',"None") -%}
First you should {{ states('sensor.'~object_name~'chore_one') }}.
{% if not is_state('sensor.'~object_name~'chore_two',"None") -%}
After that, you can {{ states('sensor.'~object_name~'chore_two') }}
{% if not is_state('sensor.'~object_name~'chore_three',"None") -%}
Finally, you can always {{ states('sensor.'~object_name~'chore_three') }}
{% endif -%}
{% endif -%}
{%- else -%}
{{ closing_line }}
{% endif -%}
fields:
room:
description: Choose room to hear chores associate with the selected room (takes prescedence over person)
example: Blue Room
selector:
select:
options:
- Blue Room
- Computer Area
- Dining Room
- Entryway
- Front Room
- Furnace Room
- Garage
- Kitchen
- Great Room
- Mancave
- Master Bathroom
- Master Bedroom
- Nursery
- Utility Room
- Other
person:
description: Choose person to hear chores associate with that person (if a room is not chosen)
example: Daddy
selector:
select:
options:
- Daddy
- Chickadee
- Marshall
- Tess
- Emmett
- Bridget
- Ebin
- Other
speaker:
description: Speaker to announce chores on
example: media_player.announcements
selector:
entity:
domain: media_player