Skip to content

Instantly share code, notes, and snippets.

@peyanski
Created August 20, 2025 06:51
Show Gist options
  • Select an option

  • Save peyanski/137ae70c0557b1217266755eafe63653 to your computer and use it in GitHub Desktop.

Select an option

Save peyanski/137ae70c0557b1217266755eafe63653 to your computer and use it in GitHub Desktop.
alias: Weather and comfort report
sequence:
- action: ai_task.generate_data
data:
task_name: weather comfort report
instructions: |
Based on the current conditions:
- Outdoor temperature: {{ states('sensor.outdoor_temperature') }}°C
- Indoor temperature: {{ states('sensor.family_room_temperature') }}°C
- Indoor humidity: {{ states('sensor.family_room_humidity') }}%
Generate a funny weather description and assess indoor comfort level.
structure:
weather_description:
description: A humorous description of the current weather outside
required: true
selector:
text: null
indoor_comfort:
description: Assessment of how comfortable it is inside compared to outside
required: true
selector:
text: null
response_variable: comfort_report
- action: notify.persistent_notification
data:
title: 🏠 Home climate report
message: |
🌤️ **Weather outside:**
{{ comfort_report.data.weather_description }}
🛋️ **Indoor comfort:**
{{ comfort_report.data.indoor_comfort }}
@Milfeldt
Copy link

Hmmmm!? I get: Message malformed: extra keys not allowed @ data['sequence']

@peyanski
Copy link
Author

Hmmmm!? I get: Message malformed: extra keys not allowed @ data['sequence']

I just test this script again and it worked flawlessly. Where did you get that error during saving of the script or when you are trying to execute it? Also double check that you are saving the above YAML code as script and not as automation

@Milfeldt
Copy link

Milfeldt commented Oct 22, 2025

Sorry, my bad!
Tinkering with HA when tired, is a bad idea...
Script! Not automation ;-)
It works fine :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment