Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jewish Calendar - Times is broken #18731

Closed
tes5884 opened this issue Nov 26, 2018 · 24 comments · Fixed by #25726
Closed

Jewish Calendar - Times is broken #18731

tes5884 opened this issue Nov 26, 2018 · 24 comments · Fixed by #25726

Comments

@tes5884
Copy link

tes5884 commented Nov 26, 2018

Home Assistant release with the issue:
0.82.1

Last working Home Assistant release (if known):
Never

Operating environment (Hass.io/Docker/Windows/etc.):
Docker

Component/platform:
jewish_calendar - https://www.home-assistant.io/components/sensor.jewish_calendar/

Description of problem:
mga_end_shma & first_stars don't work at all. Times don't change, and they're completely wrong for the timezone (NY-EST).

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

  - platform: jewish_calendar
    language: english
    diaspora: True
    latitude: 41.0887620
    longitude: -74.0737290
    sensors:
      - date
      - weekly_portion
      - holiday_name
      - mga_end_shma  
      - first_stars

Traceback (if applicable):


Additional information:
image_79

@tes5884
Copy link
Author

tes5884 commented Nov 28, 2018

@tsvi not sure if you're getting notifications..

@tsvi
Copy link
Contributor

tsvi commented Nov 28, 2018

Thanks @tes5884

I'll check what happened

@tsvi
Copy link
Contributor

tsvi commented Nov 28, 2018

Could you post the following part of your config:

homeassistant:
  latitude:
  longitude:
  time_zone:

That's where the component gets its time zone from.

But I think I should add an option to set the timezone for the sensor manually as I'm planning to add in the future the possibility to set multiple sensors.

@tes5884
Copy link
Author

tes5884 commented Nov 28, 2018

homeassistant:
  latitude: 41.0887620
  longitude: -74.0737290
  time_zone: America/New_York

@ac2323
Copy link

ac2323 commented Nov 28, 2018

I'm having the same issue. Tried with and without specifying the longitude/latitude, the result is the same.

@tsvi
Copy link
Contributor

tsvi commented Nov 29, 2018

Ok, i tried your config and it works for me 😞.

So this probably because your hardware clock is synchronized to local time and not UTC.
I'll go on a hunch and say your not using hassio, rather a Linux dual-booting with Windows.

Could you specify the platform you're using, that way we can do some more checks to find the culprit?

@tes5884
Copy link
Author

tes5884 commented Nov 29, 2018 via email

@tsvi
Copy link
Contributor

tsvi commented Nov 29, 2018

Please try adding the time date component. That way we can see what time home assistant is thinking it is.
https://www.home-assistant.io/components/sensor.time_date/

@ac2323
Copy link

ac2323 commented Nov 29, 2018

Like @tes5884, I'm using Docker on a fully Linux host with the same /etc/localtime mapping. I already have the time_date component and it does show the correct time.

@tes5884
Copy link
Author

tes5884 commented Nov 30, 2018

sensor.time shows the correct local time, and sensor.time_utc gives the correct UTC time...

@mikeage
Copy link
Contributor

mikeage commented Dec 1, 2018

I'm not sure if it's the same issue, but I never see holyness updates. It's been on 0 for the last 24 hours, which, no matter what the timezone or location is, is not reasonable ;-)
[let me know if you'd rather this be a separate issue, and what other info to provide (I'm on 0.83.1)]

@tes5884
Copy link
Author

tes5884 commented Dec 6, 2018 via email

@mikeage
Copy link
Contributor

mikeage commented Dec 6, 2018

I do see Chanuka appearing, but there was nothing last Shabbat/os. I was expecting to see that as well... though now that I'm reading the docs a bit more carefully, I realize this may only be chagim. Did I misunderstand? [also, regarding chagim, is there any indication of erev chag? I'm looking for a way to automate something X minutes before candlelighting, for example...]

@tsvi
Copy link
Contributor

tsvi commented Dec 6, 2018

@mikeage you can open a new issue for this. You're correct that at the moment it doesn't show shabatot. @arigilder is helping me improve the hdate library. His latest pull request should allow us to provide such functionality. I suppose it will be merged into home assistant somewhere in the coming weeks bli neder.

@tes5884 I haven't found the time to replicate your installation. Could you try and map /etc/timezone as well? Google tells me this might solve the issue.

@mikeage
Copy link
Contributor

mikeage commented Dec 6, 2018

The HA guidelines suggest that github issues are only for bugs, not feature requests, so I'm not going to open anything here, especially since I've gotten to mention it via an unrelated issue ;-)

In any case, thanks, and sorry for wasting your time with my misunderstanding of what the library provides :-)

@tsvi
Copy link
Contributor

tsvi commented Dec 6, 2018

@mikeage feel free to open up issues on royi1000/py-libhdate for feature requests pertaining home assistant. I'll add a label for home assistant specific issues

@mikeage
Copy link
Contributor

mikeage commented Dec 6, 2018

Thanks. It looks like py-libhdate/py-libhdate#33 should provide everything, though (with the next_day() function)

@arigilder
Copy link
Contributor

FYI the goal is to ultimately have a suite of "upcoming shabbat/yom tov" sensors for jewish_calendar. I actually have this working quite nicely with a Hebcal integration right now and have some great pre-Shabbat/Yomtov automations, but as @tsvi pointed out, local calculations are better -- I actually just found that to be the case with Shabbat Chanukah, where the Hebcal API spits out an illogical response for havdalah then. So the jewish_calendar sensor will use next_day to detect if it's erev Shabbat/Yomtov.

Beyond that, hopefully we can expose more functionality to HA.

@tes5884
Copy link
Author

tes5884 commented Dec 6, 2018

@tes5884 I haven't found the time to replicate your installation. Could you try and map /etc/timezone as well? Google tells me this might solve the issue.

No luck...

@ac2323
Copy link

ac2323 commented Jan 15, 2019

Any update on this?

@stale
Copy link

stale bot commented Jul 7, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 7, 2019
@tsvi
Copy link
Contributor

tsvi commented Jul 7, 2019

I suppose this is still an issue as I haven't looked into it yet.

@stale stale bot removed the stale label Jul 7, 2019
tsvi added a commit to tsvi/home-assistant that referenced this issue Aug 6, 2019
Use new hdate version of library which uses pytz for timezones.
dateutil expects /usr/share/timezone files, as these are not available
in the docker image and in HASSIO, the timezone offsets are broken.

This should fix
 - home-assistant#23032
 - home-assistant#18731
andrewsayre pushed a commit that referenced this issue Aug 6, 2019
Use new hdate version of library which uses pytz for timezones.
dateutil expects /usr/share/timezone files, as these are not available
in the docker image and in HASSIO, the timezone offsets are broken.

This should fix
 - #23032
 - #18731
balloob pushed a commit that referenced this issue Aug 7, 2019
Use new hdate version of library which uses pytz for timezones.
dateutil expects /usr/share/timezone files, as these are not available
in the docker image and in HASSIO, the timezone offsets are broken.

This should fix
 - #23032
 - #18731
@antonbek89
Copy link

Hi
Have same problem
The : sensor.jewish_calendar_upcoming_candle_lighting show - 2:00:00 from original time

Have solutions?

@AvtechScientific
Copy link

AvtechScientific commented Apr 28, 2021

Try to launch your container as follows:

sudo docker run --init -d \
  --privileged --cap-add SYS_RAWIO --device=/dev/mem \
  --name homeassistant \
  --restart=unless-stopped \
  -v /home/pi/homeassistant:/config \
  --network=host \
  -e TZ=Asia/Jerusalem \
  homeassistant/raspberrypi-homeassistant:stable

without mapping Debian's /etc/localtime onto Alpine's file, which might be a bad practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants