iobroker-community-adapters / ioBroker.pvforecast

Forecast for your photovoltaic plant in ioBroker
Other
26 stars 15 forks source link

The solcast api response is in UTC Time #26

Closed Morluktom closed 2 years ago

Morluktom commented 2 years ago

The problem

The solcast api response is in UTC Time. So the adapter has to convert the time to local time.

Version of nodejs

14.18.2

Version of ioBroker js-controller

4.0.23

Version of Adapter

2.1.4

Operating system running ioBroker

Linux

Checklist of files to include below

Additional information & file uploads

image

klein0r commented 2 years ago

You're right. I've compared the output of forecast.solar with Solcast:

Screenshot 2022-06-02 at 09 14 06
klein0r commented 2 years ago

The response for a Solcast Timestamp is 2022-05-23T09:00:00.0000000Z

The solcast script manipulates the time string:

https://github.com/iobroker-community-adapters/ioBroker.pvforecast/blob/d8566db472d1f87d71e32fc4c2eeeac88e08b072/lib/solcast.js#L19

@MeisterTR implemented that in 3f26ff82110d27ee39609900e3cbf309a5ee64ab with the comment "update". I don't know the reason for the replacement, but that leads to the time shift.

I will remove that line in the next version (with added unit tests for different time zones).

Morluktom commented 2 years ago

I try the Github Version today. Everythink looks fine. Great Job, thanks!

klein0r commented 2 years ago

Fixed in v2.1.5