Display sun settings minus offset on card

Hello,

I have created atemplate sensor to display the sun next_setting time on a card

sun_sun_next_setting_time:
value_template: ‘{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom("%H:%M") }}’

because I use an automation with a offset off 30 minutes I also want to display a sensor to display the
time the automation will be executed. How do I substract 30 minutes from “states.sun.sun.attributes.next_setting”?

{{ (as_timestamp(states.sun.sun.attributes.next_setting) - 1800) | timestamp_custom("%H:%M") }}

30 minutes = 1800 seconds

2 Likes

Okay! Sometimes it is so easy :slight_smile:

(now().strftime(“%s”) | int + 300) was confusing me :frowning: