#My first script...its a cluster!

1 messages · Page 1 of 1 (latest)

lucid lake
#

Hello forum. Installed a windows desktop with linux and set up my very first HA yesterday! My dashboard is a bit messy but its progress.

I have two lamps at the bedside. One in my name and one in my partner (each a colour in the grab).
I thought my request was simple. Turn on the lights at 9:30 pm to 50% brightness.
Then gradually have them dim at a rate of 1% per minute until they both reach 10% and then stay on until I manually turn them off.

This isnt the final idea but I wanted to play around.

So, I fired up a commercial session of ChatGPT and explained exactly the same.

The first script seemed fine. Turn on the lamps at 9:30.

But the second one keeps throwing out an error. "Message malformed extra keys no allowed @ data['sequence']"

No matter what GPT told me (and we tried for over an hour!) the message was always the same.

Needless to say, I want to give up and bin the whole machine and idea at this point. Very frustrating. It seems that GPT is giving me instructions which don't even have the same buttons as the actual interface and I am feeling very demoralised by it.

Here is the syntax it gave me. Please can anyone help. I thought this would be an easy start but if this is how hard it is, I have no idea how I am going to make more complex tasks possible.

crimson latch
#

So... ChatGPT is just going to cause you more frustrations than anything. It's very good at guiding people down the incorrect path, even if it's something that looks like it'll work.

You should familiarize yourself with an automation: https://www.home-assistant.io/docs/automation/yaml/#yaml-example

There is the visual editor as well, in case that's more your style.... your main issue here is that's not an automation, that's more inline with a script.

An automation contains at least 1 trigger and may have conditions, followed by actions.

Home Assistant

How to use the automation integration with YAML.

brisk granite
#

The sequence code looks to me to be syntactically correct if a bit roundabout. Automations also need a trigger, which you don't have. And I believe comments are not supported in the UI yaml editor.

#

And agreed, it is far better to learn the automation logic/syntax than to rely on a GPT to generate the code for you.

pseudo walrus