Use current time in telegram message

Hi.

I’m trying HA for the second time. I switched from domoticz to HA for a couple of days a while back butnduentovthe difficulty levelvi went back to domoticz. Now I’m back again this time for good. Domoticz it too buggy. However a simple task in domoticz is impossible for me here. I want to sent a message with telegram, that works. I just want to add the current time in the message. I cannot get it to work. How do you use the system time.

I tried to make an if then else statement and use the else a new if but is that possible.

You can use a template…

....
action:
  - service: notify.YOUR_TELEGRAM
    data:
      title: Title
      message: "Message  {{ now() }}"

now() returns a datetime object string like 2022-10-18 10:23:45.6789-01:00. If that isn’t want you want, you can use a number of methods to format the output the way you need.

I found that option and That is exactly I don’t want. I only want the time but I’m stuck on the formatting

What do you want the format to be?

HH:MM:SS can be attained using:

{{ now().strftime("%H:%M:%S") }}

Yes. That worked. Is there a way I can find all the possible commands and syntaxes. In domoticz it is auto filled in so you can easily browse through all of them.

strftime() format codes

The EPIC Time Conversion Thread