devRoemer / node-red-contrib-time-switch

A node that switches on and off depending on the current time
MIT License
3 stars 1 forks source link

Geolocator not working in a container #15

Closed MrMophandle closed 2 years ago

MrMophandle commented 2 years ago

Describe the bug Lat and Long are not respected. No matter what I input, UTC time is used. My suspicion is that being in a container is messing up the geo locator. Not sure how though. :(

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior I would expect inputting my latitude and longitude would result in me being able to use local time. IE, putting 'sunset' would mean my sunset, not UTC sunset.

Screenshots 2021-11-22_22-40-11

2021-11-22_22-41-27

Environment (please complete the following information): Running Node Red in a container on a raspberry pi

Server: Docker Engine - Community Engine: Version: 20.10.10 API version: 1.41 (minimum version 1.12) Go version: go1.16.9 Git commit: e2f740d Built: Mon Oct 25 07:40:35 2021 OS/Arch: linux/arm Experimental: false containerd: Version: 1.4.11 GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8 runc: Version: 1.0.2 GitCommit: v1.0.2-0-g52b36a2 docker-init: Version: 0.19.0 GitCommit: de40ad0

Additional context Add any other context about the problem here.

MrMophandle commented 2 years ago

SOLVED:

I'm an idiot. I didn't set the timezone in the container. Once I did that, everything started working normally.

I added the following to the startup command (I'll add it to the compose file later)

-e TZ=America/New_York