mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 22:06:50 +00:00
Mealie - Add example template sensor and tip (#33704)
* Add example and tip * Update source/_integrations/mealie.markdown Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Correct capitlization * Refine example template sensor * Typos * Remove quotes They don't render in a details section * Fix line wrap * Update services to actions * Tiny tweak --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
0eae99acab
commit
c0611608da
@ -81,4 +81,40 @@ Import the recipe into Mealie from a URL.
|
||||
|------------------------|----------|-----------------------------------------------------------------|
|
||||
| `config_entry_id` | No | The ID of the Mealie config entry to get data from. |
|
||||
| `url` | No | The URL of the recipe. |
|
||||
| `include_tags` | Yes | Include tags from the website to the recipe. (false by default) |
|
||||
| `include_tags` | Yes | Include tags from the website to the recipe. (false by default) |
|
||||
|
||||
{% tip %}
|
||||
You can get your `config_entry_id` by using actions within [Developer Tools](/docs/tools/dev-tools/), using one of the above actions and viewing the YAML.
|
||||
{% endtip %}
|
||||
|
||||
## Examples
|
||||
|
||||
{% details "Example template sensor using get_mealplan" %}
|
||||
|
||||
Example template sensor that contains today's dinner meal plan entries:
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
template:
|
||||
- trigger:
|
||||
- platform: time_pattern
|
||||
hours: /1
|
||||
action:
|
||||
- service: mealie.get_mealplan
|
||||
data:
|
||||
config_entry_id: YOUR_MEALIE_CONFIG_ENTITY_ID
|
||||
response_variable: result
|
||||
sensor:
|
||||
- name: "Dinner today"
|
||||
unique_id: mealie_dinner_today
|
||||
state: >
|
||||
{% for meal in result.mealplan if meal.entry_type == "dinner" -%}
|
||||
{{ meal.recipe['name'] if meal.recipe is not none else meal.title }}
|
||||
{{ ", " if not loop.last }}
|
||||
{%- endfor %}
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
{% enddetails %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user