Hi, I have a sensor named ‘sensor.street_cleaning’ that contains day of the street cleaning in String format. I’m looking for creating an automation that will send me notification to move my car the day before street cleaning. For example, if sensor’s state says ‘Tuesday’ then I should receive notification on Monday. Is it possible
This is close to what my needs I found online but not working for me.
alias: Send notification if tomorrow is Monday
trigger:
- platform: time
at: '12:00:00'
condition:
condition: template
value_template: "{{ (is_state('sensor.accord_street_cleaning_2', 'Monday') and now().weekday() == 0) or (is_state('sensor.accord_street_cleaning_2', 'Tuesday') and now().weekday() == 1) or (is_state('sensor.accord_street_cleaning_2', 'Wednesday') and now().weekday() == 2) or (is_state('sensor.accord_street_cleaning_2', 'Thursday') and now().weekday() == 3) }}"
action:
- service: notify.pushbullet
data:
message: "Tomorrow is Monday, Tuesday, Wednesday, or Thursday!"```
Where did you learn that you can use the Template Editor to test an automation?
The trigger variable only exists when an automation’s trigger is triggered. Reference: Testing your automation
If not triggered by the automation’s trigger, the trigger variable is undefined so any template containing the trigger variable cannot be tested in the Template Editor.