Automation to set a date label when entity has a value

Im trying to use the GUI editor to create an automation.

Basically I have an SNMP ‘sensor’ that returns the status of my UPS

1 = Online
2 = OnBattery

I simply want to create an automation that writes a label for 'Last Power Outage" as a date

The GUI continues to throw errors that I am incorrect with my formatting, and the ‘condition’ I have for ‘UPS Status’ never passes.

I would prefer to do this in the GUI rather than through a manual yaml file

You need to show something. The ‘description’ gives nothing.

As said, very little detail. We at least need to see what you tried and the exact error you got.

That said, you don’t need any conditions. Just trigger on the state being 2 and set an input datetime helper to now() (via a call service action in the UI).

Hey guys,

Sorry about the lack of detail in my original post. I have tried ‘date’, ‘datetime’, and a few others that I found on the forum, now I have tried ‘now()’ and I get the following error no matter what

I don’t use the UI for many things, but try it like this: {{ now() }} (with the datetime option). Otherwise, this with the timestamp option: {{ now().timestamp() }}.

I had to end up editing in YAML mode, but it does work. I feel like the HA GUI is super lacking and most people have just accepted that you have to do everything via YAML.

Thank you for your help