Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save peyanski/a8b573079d911efbf5ea0b807d8668d1 to your computer and use it in GitHub Desktop.
Save peyanski/a8b573079d911efbf5ea0b807d8668d1 to your computer and use it in GitHub Desktop.
alias: Weather-Based Clothing Suggestion (All Data to AI)
description: Send entire hourly forecast to AI for clothing suggestion
triggers:
- trigger: state
entity_id: input_button.start_automation
to: null
actions:
- action: weather.get_forecasts
target:
entity_id: weather.forecast_home
data:
type: hourly
response_variable: hourly_forecast
- variables:
forecast_list: "{{ hourly_forecast['weather.forecast_home'].forecast | default([]) }}"
- action: ai_task.generate_data
data:
task_name: Suggest Clothing
instructions: >-
Here is the upcoming hourly weather forecast in JSON: {{ forecast_list |
tojson }}
Based only on this data, suggest appropriate clothing in a short, funny
message. Provide only one suggestion and keep it under 20 words.
response_variable: ai_response
- action: persistent_notification.create
data:
title: Clothing Suggestion
message: "{{ ai_response.data | default('No clothing suggestion available.') }}"
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment