Thanks so much!
I would like to fire automations every odd day of the month or vice versa
For example: automation should run on 1-3-5…31 dated days
Or should run 2-4-6…30th days of the month
If 2 days have same out put for the last of the month it doesn’t matter
Thanks again
Ok, for true on even numbered days of the month:
{{ now().day % 2 == 0 }}
and for true on odd numbered days of the month:
{{ now().day % 2 == 1 }}
1 Like
Really appreciate your support!
Many thanks
fillwe
(Fillwe)
July 24, 2018, 11:10am
24
Hey everyone, please if any one could answer this. How should I do to get a template sensor that just displays the current week as a number? for example “30” as it is now.
sensor:
- platform: time_date
display_options:
- 'date'
- platform: template
sensors:
week:
friendly_name: Week Number
value_template: >
{{ strptime(states('sensor.date'), '%Y-%m-%d').strftime('%V') }}
Depending on how your sensor.date is formatted, you may need to adjust the strptime format string accordingly.
1 Like
fillwe
(Fillwe)
July 24, 2018, 12:14pm
26
Thank you sooo much, you’re a godsend!
1 Like