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.

Watchman Updated sensor Invalid Timestamp

See original GitHub issue

I have noticed a small bug with the timestamp formatting of the sensor.watchman_last_updated entity when using the iOS / iPadOS Home Assistant apps.

When viewing any lovelace dashboards with the watchman_last_updated entity displayed, the entity would show as Invalid timestamp and I would get the following error in the HA logs: ERROR (MainThread) [frontend.js.latest.202203010] https://[my-HA-URL]/frontend_latest/92deadc4.js:258:77216 RangeError: number argument must be finite

The errors do not occur on Windows with Edge.

The error did not occur for any of my other device_class: timestamp entities. Looking at the formatting of my working entity it is using (what I have just learnt is) the ISO 8601 format of YYYY-MM-DDTHH:MM:SS+UTCOFFSET, e.g. 2022-03-03T14:12:17+00:00

The watchman_last_updated sensor is substituting the T with a space character, e.g. 2022-03-10 17:33:25.133995+11:00

I found that the HA templating documentation reference this issue:

If your template is returning a timestamp that should be displayed in the frontend (e.g., as a sensor entity with device_class: timestamp), you have to ensure that it is the ISO 8601 format (meaning it has the “T” separator between the date and time portion). Otherwise, frontend rendering on macOS and iOS devices will show an error.

I’m running: Watchman: 0.5.0 (through HACS) Home Assistant Core: 2022.3.2 Supervisor: 2022.03.2 Home Assistant OS: 7.4 Hardware: Raspberry Pi 4b

Would the date format of the sensor be something you would be happy to change? Let me know if there is any other information or testing I can help with, and thanks very much for a great integration!

Edit: The above documentation suggests enforcing iso conversion with the function isoformat(). That didn’t work for me with the watchman sensor, but for testing, I created the below template sensor which did not generates the errors: - name: "Watcher Test" state: "{{ as_timestamp(states('sensor.watchman_last_updated')) | timestamp_custom('%Y-%m-%dT%H:%M:%S%z') }}" device_class: timestamp

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Daneishcommented, Apr 25, 2022

I can confirm it’s now displaying correctly and no longer generating an error. Thanks very much!

1reaction
Daneishcommented, Mar 19, 2022

Thanks very much. And thanks again for a great integration, it has helped me find many loose ends I didn’t know I had!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sensor as_timestamp rendered invalid timestamp after ...
I want to display the date and time of an entity on my dashboard but since the last HA update this isn't possible...
Read more >
Troubleshooting | Watchman - Meta Open Source
A recrawl is an action that Watchman performs in order to recover from situations where it believes that it has lost sync with...
Read more >
Improve Light Disambiguator · Issue #4 · cntools/libsurvive
The light disambiguator is right now very poor. Located in survive_process.c it is rather simplistic, and something terrible happens when ...
Read more >
Error when running watchman - react native - Stack Overflow
Closing the tab completely and then opening the debugger in a new tab solved the issue. if none of the above solution doesn't...
Read more >
Error sending "Email": Connection failed ("smtp.office365.com")
Hi,. I'm having problems configuring Office 365 SMTP relay in notification settings. Particular configuration values work well when tested from the same ...
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