Eror set up number

From last week i have been trying to write a script using set up action. I have a number and i tried to set it up using a sensor value .
Below I wrote the script

action: number.set_value
, metadata: {}
, data:
, value: " value: "2 Left curly bracket states(‘sensor.zona1min’) | float(0) * 10 2 Right curly bracket\2 Quote
, target:
, entity_id: number.sprinkler_a
, , Edit box

This is my eror:
Failed to perform the action script/new_script_3. expected float for dictionary value @ data[‘value’], status

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Your script’s action should look like this:

action: number.set_value
target:
  entity_id: number.sprinkler_a
data:
  value: "{{ states('sensor.zona1min') | float(0) * 10 }}"

I tried this code and in u. I copy this code. sequence:
, - action: number.set_value
, metadata: {}
, data:
, value: “2 Left curly bracket states(‘sensor.zona1min’) | float(0) * 10 2 Right curly bracket”
, target:
, entity_id: number.sprinkler_a
, alias: Set number volume.
, description: 2 Quote
, , Edit box I want the script, but the number is not changing. It’s the same.

Compare the appearance of the example I posted to the appearance of what you posted.

Why is your version in a completely different (and invalid) format?

The code is diferent because UI interface. I dont know how to write it in yaml files.

Home Assistant’s Script and Automation Editors have two editing modes:

  1. Visual
  2. YAML

Switch the mode from Visual to YAML, copy the displayed YAML code and paste it into your forum message. Then format it by following the instructions in guideline #11 in the FAQ.

sequence:

  • action: number.set_value
    metadata: {}
    data:
    value: “{{ states(‘sensor.zona1min’) | float(0) * 10 }}”
    target:
    entity_id: number.sprinkler_a
    alias: Set number volume.
    description: “”

That’s better but still needs improvement. Follow the instructions in guideline 11 of the FAQ.

sequence:

  • action: number.set_value
    metadata: {}
    data:
    value: “{{ states(‘sensor.zona1min’) | float(0) * 10 }}”
    target:
    entity_id: number.sprinkler_a
    alias: Set number volume.
    description: “”

> Blockquote

f6be36681e0da431418ec7781fb6c62712941803

After the last update of home assistant I successfully successfully use this script is

action: number.set_value
target:
  entity_id: number.sprinkler_a
data:
  value: "{{ states('sensor.zona1min') | float(0) * 10 }}"

Below is the new error

Value 90 for number.sprinkler_a is outside valid range 1.0 - 60.0., status the sensor value zone 1 min is 9 and the script set 90

I found the error now it’s everything okay below is my new code is working

sequence:
  - action: number.set_value
    metadata: {}
    data:
      value: "{{ states('sensor.zona1min') | float(0) }}"
    target:
      entity_id: number.sprinkler_a
alias: Sprinkler, a set time.
description: ""