here is my problem
value: “{{(states(‘sensor.time_formatted’)) |string}}”
I made an automation needs to write every end of the month a value to an input_datetime
but I don’t know how to write it
sensor.time_formatted looks like this : 21 januari 09:15-09:30
it just has to be copy paste. it is the quarter in a month that has the highest energy use. that’s important in belgium. Each month it resets. so at the end of every month I want it copied to another entity ( helper), so I can see the difference each month
I’m not sure how to answer that. Yes, you need to run the input_text.set_value service in order to populate your text helper.
The code above (starting service:) is YAML configuration for part of a Script or Automation action that will do that. That YAML contains a couple of Jinja templates (the bits in {{...}}) to get the name of the month’s text entity and the time you want to record.
The Template Editor only deals with the Jinja aspects of the input. Your screenshot from the Template Editor above shows it inserting the outputs from the two Jinja templates into the YAML, showing what the resultant code will look like at this point in time when you run it in a script or automation. The Template Editor does not actually do anything though: it’s just a useful tool for getting your Jinja templates doing what you want before you use them in your configuration.