question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Islamic Prayer Times issue with the sensor integration after Core update - does not support platform setup

See original GitHub issue

The problem

Hi HA community,

after I update the system to the recent version the slamic Prayer Times sensor stop working. it seems the new update time template is not compatiable with the integration. see below log

Logger: homeassistant.components.template.trigger Source: components/template/trigger.py:60 Integration: template (documentation, issues) First occurred: 11:22:39 PM (17 occurrences) Last logged: 11:22:39 PM

Error initializing ‘template’ trigger for ‘Sunrise’: ValueError: Template error: strptime got invalid input ‘2022-06-07T09:42:00+00:00’ when rendering template ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.sunrise_time”), “%Y-%m-%dT%H:%M:%S”)) }}’ but no default was specified

Error initializing ‘template’ trigger for ‘Duher reminder’: ValueError: Template error: strptime got invalid input ‘2022-06-07T17:21:00+00:00’ when rendering template ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.dhuhr_prayer”), “%Y-%m-%dT%H:%M:%S”)) -600 }}’ but no default was specified

Error initializing ‘template’ trigger for ‘Asr reminder’: ValueError: Template error: strptime got invalid input ‘2022-06-07T21:26:00+00:00’ when rendering template ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.asr_prayer”), “%Y-%m-%dT%H:%M:%S”)) -600 }}’ but no default was specified

Error initializing ‘template’ trigger for ‘Magrib reminder’: ValueError: Template error: strptime got invalid input ‘2022-06-08T01:00:00+00:00’ when rendering template ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.maghrib_prayer”), “%Y-%m-%dT%H:%M:%S”)) -600 }}’ but no default was specified

Error initializing ‘template’ trigger for ‘Isha reminder’: ValueError: Template error: strptime got invalid input ‘2022-06-08T02:48:00+00:00’ when rendering template ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.isha_prayer”), “%Y-%m-%dT%H:%M:%S”)) -600 }}’ but no default was specified

What version of Home Assistant Core has the issue?

Home Assistant Core 2022.6.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Islamic Prayer Times

Link to integration documentation on our website

https://www.home-assistant.io/integrations/islamic_prayer_times/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Error evaluating 'template' trigger for 'Sunrise': ValueError: Template error: strptime got invalid input '2022-06-07T09:42:00+00:00' when rendering template '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.sunrise_time"), "%Y-%m-%dT%H:%M:%S")) }}' but no default was specified
11:22:41 PM – (WARNING) template - message first occurred at 11:22:41 PM and shows up 17 times
Error while processing template: Template("{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.sunrise_time"), "%Y-%m-%dT%H:%M:%S")) }}")
11:22:39 PM – (ERROR) helpers/template.py - message first occurred at 11:22:39 PM and shows up 17 times
Error initializing 'template' trigger for 'Sunrise': ValueError: Template error: strptime got invalid input '2022-06-07T09:42:00+00:00' when rendering template '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.sunrise_time"), "%Y-%m-%dT%H:%M:%S")) }}' but no default was specified
11:22:39 PM – (WARNING) template - message first occurred at 11:22:39 PM and shows up 17 times
The islamic_prayer_times platform for the sensor integration does not support platform setup. Please remove it from your config.
11:22:22 PM – (ERROR) Sensor



2022-06-07 23:22:22 ERROR (MainThread) [homeassistant.components.sensor] The islamic_prayer_times platform for the sensor integration does not support platform setup. Please remove it from your config.
2022-06-07 23:22:39 WARNING (MainThread) [homeassistant.components.template.trigger] Error initializing 'template' trigger for 'Adhan': ValueError: Template error: strptime got invalid input 'unknown' when rendering template '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_times_fajr_prayer"), "%Y-%m-%dT%H:%M:%S")) }}' but no default was specified
2022-06-07 23:22:39 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_times_fajr_prayer"), "%Y-%m-%dT%H:%M:%S")) }}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1546, in strptime
return datetime.strptime(string, fmt)
File "/usr/local/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/usr/local/lib/python3.9/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data 'unknown' does not match format '%Y-%m-%dT%H:%M:%S'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1842, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/local/lib/python3.9/site-packages/jinja2/sandbox.py", line 393, in call
return __context.call(__obj, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1549, in strptime
raise_no_default("strptime", string)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1331, in raise_no_default
raise ValueError(
ValueError: Template error: strptime got invalid input 'unknown' when rendering template '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_times_fajr_prayer"), "%Y-%m-%dT%H:%M:%S")) }}' but no default was specified
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 525, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 411, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: strptime got invalid input 'unknown' when rendering template '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_times_fajr_prayer"), "%Y-%m-%dT%H:%M:%S")) }}' but no default was specified

Additional information

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
engrbm87commented, Oct 27, 2022
1reaction
tdejnekacommented, Jun 8, 2022

Instead of a Template Trigger, use a Time Trigger. The sensor’s time format is ideal for use in a Time Trigger.

trigger:
  - platform: time
    at: sensor.dhuhr_prayer
Read more comments on GitHub >

github_iconTop Results From Across the Web

Automate Islamic Adhan (also called Azan or Azzan) or other ...
Hello, I am using version 2022.7.4, I have installed islamic prayer times, all is well, but the adhan won't go off automatically. I...
Read more >
The Islamic prayer (Salah/Namaaz) and yoga togetherness in ...
The technique used in therapy, therefore, should be based on accepting and acknowledging that many religious, spiritual, and ethnic clients believe that God...
Read more >
GlobalTrends_2040.pdf
Global. Trends reflects the National Intelligence Council's perspective on these future trends; it does not represent the official, coordinated view of the US ......
Read more >
Athan: Prayer Times & Al Quran 4+ - App Store
Stay on top of your Prayers with Athan, read the Holy Quran, Qibla indicator to get accurate Qibla direction and Islamic Calendar to...
Read more >
IMPLEMENTATION OF THE SUSTAINABLE DEVELOPMENT ...
Israel stands united with all UN member states in the support and implementation of the 2030 Agenda ... so that after submitting Israel's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found