Automation based on dates

Hi everyone,

First of all i want to thanks everyone with all the help i got with different kind of issues.
Im struggling with an automation i want to get going :slight_smile:

I have this dates:
image

What i want. When for example the date of ’ Avri gft’ is the actual date, i want to get a message from pushbullet and a notification in Lovelace. Anyone has an idea how to get this to work?

Thanks!

What have you tried?


 - alias: 'Reminder Groene kliko'
    trigger:
      - platform: template
        value_template: "{% if is_state('sensor.avri_gft', 'sensor.date') %}true{% endif %}"
    action:
      - service: notify.pushbullet
        data_template:
          message: "Groene kliko moet aan de straat"
        data:
          title: 'Groene Kliko'

How can this ever be “true”?

This is why i ask for help? if i understand you i dont understand the clue.

“{{ states(‘sensor.avri_gft’) == states(‘sensor.date’) }}”

Have you even tried any of this in the template editor ?

The template editor is your best friend

A search on “current date” gives the answer: Help with automation and template to fire when manual datetime is input

1 Like

I have to say finity, though that is an excellent link, I never knew it existed.
If I’d read that (I’m going to read that tonight) it may have saved me a LOT of grief in the past.
:+1:

1 Like

Hi guys, thanks for all the replies.
I think im am a noobie with automations that aren’t in examples here on the forums.
i was struggling with the template editor. I finally got it working. but now i want to add this in an automation which makes a picture from red to green ( green = if state = equal, turn green ) else turn red.
Can anyone help me out with this how to put this in the auomation.yaml? Thanks.

What works for me is:

{% if states.sensor.date.state == states.sensor.avri_gft.state %}
Put the GFT @ the road!
{% else %}
Don't do anything
{% endif %}

Thanks for the help