Hey guys,
Im using home assistant in my sauna to control lights and music and such.
Now I also provide a range of snacks/meals in the sauna and I wonder if possible, what would be a good way to get customers choose from a menu in home assistant and that I receive a mail and/or message/notifications
or if not possible to add a menu, just like a blank box where they can type in anything and that I get the message on my phone/pc
thanks in advance
pedolsky
(Pedolsky)
May 14, 2022, 8:30am
2
Do you already know the Shopping List integration?
I did not
thanks for this. I will look into it and see how this helps me
I looked into it but not sure if this can do what I need/want.
I would need to make my own list where a customer can check what they want and press a send button and that I get a mail/message
pedolsky
(Pedolsky)
May 16, 2022, 8:01pm
5
With a few helpers and 2 scripts you can create a menu selection without installing an integration. Would have an output like this:
The code:
#### INPUT SELECT
input_select:
menu_pizza:
name: Pizza
icon: mdi:pizza
options:
- …
- 1
- 2
- 3
- 4
initial: …
menu_french_fries:
name: French Fries
icon: mdi:french-fries
options:
- …
- 1
- 2
- 3
- 4
initial: …
menu_cucumber_salad:
name: Cucumber Salad
icon: mdi:sprout
options:
- …
- 1
- 2
- 3
- 4
initial: …
#------------------------------------------------------------#
#### INPUT TEXT
input_text:
menu_freetext:
name: Free-text
icon: mdi:pencil-outline
initial: ' '
#------------------------------------------------------------#
#### GROUP
group:
menu_selection:
entities:
- input_select.menu_pizza
- input_select.menu_french_fries
- input_select.menu_cucumber_salad
#------------------------------------------------------------#
#### SCRIPT
script:
menu_messaging:
alias: Menu Messaging
icon: mdi:cast-audio-variant
sequence:
- service: notify.YOUR_NOTIFY_SERVICE
data:
target: YOUR_NOTIFY_ENTITY
title: Order {{ now().strftime('%F | %R') }}
message: |
{% for item in expand('group.menu_selection') -%}
{% if states(item.entity_id) != '…' %}
{{ states(item.entity_id) }} x {{ item.attributes.friendly_name }}
{% endif %}
{%- endfor -%}
{% set text = states('input_text.menu_freetext') %}
{{ 'Additional information: ' ~ text if text |length > 1 else 'none' }}
menu_fields_clear:
alias: Clear Menu Selection
icon: mdi:trash-can-outline
sequence:
- service: input_select.select_option
data:
option: …
target:
entity_id:
- input_select.menu_pizza
- input_select.menu_french_fries
- input_select.menu_cucumber_salad
- service: input_text.set_value
data:
value: ''
target:
entity_id: input_text.menu_freetext
this is amazing. thanks you so much