Comments (9)
Run this flow and what does it display in the debug tab?
[{"id":"8f353b43.9369c8","type":"inject","z":"5eb3594f.d294b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":92,"y":672,"wires":[["42e6362a.003848"]]},{"id":"d972a939.f4a9c8","type":"debug","z":"5eb3594f.d294b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":386,"y":672,"wires":[]},{"id":"42e6362a.003848","type":"function","z":"5eb3594f.d294b8","name":"","func":"msg.payload = new Date();\n\nreturn msg;","outputs":1,"noerr":0,"x":238,"y":672,"wires":[["d972a939.f4a9c8"]]}]
from node-red-contrib-home-assistant-websocket.
Mon Jan 28 2019 16:44:13 GMT-0500 (EST)
Imgur
That is the correct time by the way.
from node-red-contrib-home-assistant-websocket.
If you just attach a inject node to a current state node does it give you the incorrect time below the node?
from node-red-contrib-home-assistant-websocket.
same result, incorrect time below the node.
Imgur
Time below the node SHOULD be 18:51, not 23:51. It's displaying to UTC +0.
Something else of note, even though the timestamp is wrong on the service node, other nodes display the correct time, and I have an automation that toggles lights depending on dawn/dusk, and it operated at the appropriate time. But it still displayed the wrong timestamp underneath the service node.
edit: updated with current state node also showing incorrect time -
Imgur
from node-red-contrib-home-assistant-websocket.
This is the exact code that displays the status date. Give it a try and see if it still displays the incorrect offset.
[{"id":"8f353b43.9369c8","type":"inject","z":"5eb3594f.d294b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":92,"y":672,"wires":[["42e6362a.003848"]]},{"id":"d972a939.f4a9c8","type":"debug","z":"5eb3594f.d294b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":386,"y":672,"wires":[]},{"id":"42e6362a.003848","type":"function","z":"5eb3594f.d294b8","name":"","func":"msg.payload = new Date().toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n hour12: false,\n hour: 'numeric',\n minute: 'numeric'\n });\n\nreturn msg;","outputs":1,"noerr":0,"x":238,"y":672,"wires":[["d972a939.f4a9c8"]]}]
from node-red-contrib-home-assistant-websocket.
When I inject that node here is the debug output -
1/29/2019, 6:12:28 PM node: 8b20087a.a07d48
msg.payload : string[13]
"Jan 29, 23:12"
The time is still incorrect.
Note that the debug message timestamp is 5 hours earlier, which again, is the correct time.
from node-red-contrib-home-assistant-websocket.
Try adding the timezone via the environment variable in your docker-compose file.
node-red:
environment:
- TZ=America/New_York
from node-red-contrib-home-assistant-websocket.
Surprisingly, that fixed it. Thank you!
1/29/2019, 8:12:04 PMnode: 8b20087a.a07d48 msg.payload : string[13] "Jan 29, 20:12"
I hope this is something that could be fixed though. I could not find this information documented anywhere. Defining the localtime file as a volume should be enough imo.
Appreciate you working with me to fix this
from node-red-contrib-home-assistant-websocket.
Here's where I found it or could be something very similar to it.
from node-red-contrib-home-assistant-websocket.
Related Issues (20)
- Calendar event trigger offset doesn't work HOT 5
- Time node triggering an hour early HOT 1
- Uncaught Exception: TypeError: Cannot read properties of undefined HOT 3
- Sentence node: Error registering HOT 1
- Get History failed with 401/403 HOT 2
- 'Select' home assistant entity has unexpected behaviour HOT 1
- Render template timeout HOT 2
- Installation of 0.63.0 fails: config production Use `--omit=dev` instead HOT 6
- State of entity nodes in global context not restored HOT 4
- HA closes connection HOT 1
- Timeout on call http://172.30.32.1:8123/api/core/state and WebSocket API error HOT 3
- Device node for IKEA sound puck (remote) triggers lights on single click even when not connected HOT 1
- Connection between HA and Node Red keep Resetting HOT 17
- Home Assistant WebSocket API error: Cannot proxy websocket message of unsupported type: 257 HOT 5
- Offset and Daily event HOT 1
- Sensor Node Input Override Options are mapped incorrectly
- "Error: Invalid server config" HOT 4
- call_service node output properties HOT 1
- Call service - selecting domain & service hide area, device & entity field HOT 3
- End of all day calendar event not triggered
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-red-contrib-home-assistant-websocket.