Here you all go. I wrote these templates for a finetuning, focusing on the notify service.
I want it to be as Google Assistant as possible.
My templates:
- platform: template
sensors:
dayoftheweek:
value_template: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}"
entity_id: sensor.time
- platform: template
sensors:
month:
value_template: "{{ ['January','February','March','April','May','June','July','August','September','October','November','December'][now().month-1] }}"
entity_id: sensor.time
- platform: template
sensors:
dateofthemonth:
value_template: "{{ ['1st','2nd','3rd','4th','5th','6th','7th','8th','9th','10th','11th','12th','13th','14th','15th','16th','17th','18th','19th','20th','21th','22th','23th','24th','25th','26th','27th','28th','29th','30th','31th' ][ now().day-1] }}"
This can all be rewritten into my notify-script, that looks like this:
{% if now().strftime("%H")|int < 12 %}Good morning, {% elif now().strftime("%H")|int < 18 %}Good afternoon, {% else %}Good evening, {% endif %}{{ ["Master","Sir","Master Wayne","Sire"] | random }}.
The time is {{states.sensor.time.state}}.
Today is a {{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }} and the date is the {{states.sensor.dateofthemonth.state}} of {{states.sensor.month.state}}.
It's currently {{states.sensor.dark_sky_summary.state}} and {{states.sensor.dark_sky_temperature.state}} degrees at home. Today will be {{states.sensor.dark_sky_hourly_summary.state|replace('.','')}}, with a high of {{states.sensor.dark_sky_daytime_high_temperature_0d.state|round(1)}} degrees.
{% if states.binary_sensor.workday_sensor %}It will take {{ states.sensor.drive_to_work.attributes.duration_in_traffic }} to drive to work today in the current traffic, since you're {{ states.sensor.drive_to_work.attributes.distance|replace('km','')|float }} kilometers away.{% endif %}
Have a{{ [" pleasant", " amiable", " charming", " cheerful", " delightful", "n enjoyable", " lovely", " pleasing", " satisfying"] | random }} day!
This results in a pleasant notification with a few randomly chosen names and titles after my pleasure:
Good afternoon, Master Wayne.
The time is 15:05.
Today is a Wednesday and the date is the 15th of May.
It’s currently Partly Cloudy and 14.0 degrees at home. Today will be Mostly cloudy until tomorrow afternoon, with a high of 14.0 degrees.
It will take 1 min to drive to work today in the current traffic, since you’re 0.8 kilometers away.
Have a** satisfying day**!