Timezone issue with Power to kWh/d

Hi guys,

I’m currently attempting to replicate some of the values shown in the My Solar app, specifically the accumulation for the current day. Dan is having a look at adding a new widget for a accumulating feed value in this thread, but I noticed the other day that ‘Power to kWh/d’ popped up in the input calculator (or maybe it was always there and I didn’t notice it).

At first I thought, “Great! I can now accumulate the current day”, however unfortunately there seems to be an issue with timezone. As you can see from the graph below, the value is resetting to 0 at GMT, rather than my local timezone GMT+8. The yellow bar is the Power to kWh calculator, and the blue bar is Power to kWh/d. The reason I have both is so that I can show a feedvalue in text (top right of second picture)

Is anyone able to please have a look at this one? Thank you.

I think @TrystanLea responded to a similar query recently. Have a search around - I can’t remember what the answer was.

Hello @swhitmore @borpin I think I just suggested using the power to kWh process for a kWh per day bar graph? or I may have suggested it in combination with @danbates’s widget…

I assume your using emoncms.org @swhitmore as you mention the timezone issue, Im in the process of updating emoncms.org and as part of this I will be adding @danbates’s widget to make this possible using the power_to_kwh cumulative feed approach.

1 Like

I’ve been working on the widget again today. There’s an input field to offset the ‘time window’ manually, it’s not quite timezone support but it could be used in this regard, possibly, needs testing. It’s quite a versatile widget now although needs some more work to finish, and documentation to make clear how to use it.
I’m appreciating again that working with time gets complex because we’ve a calendar system, and when designign for weeks and months things get a little tricky.
And Javascript has nuances in regards to Datetime objects which have consumed not a small amount of today.
So bear with me.

1 Like

@TrystanLea
Done.
. dashboard/widget/kwhperiod at master · danbates2/dashboard · GitHub
same file:
kwhperiod_render.js.zip (5.1 KB)

I’ll put together some documentation tomorrow.

1 Like

Thanks @danbates and @TrystanLea Yep I’m using emoncms.org. Thanks for adding this. Do you need me to test?

No need, if you like do report back on it after you’ve tried it out.
One of us will post again, once we’ve checked it and are happy with it, and it’s uploaded to .org.
Cheers.

This gives a sense of the widget functions.
kwhperiod_doco.pdf (453.1 KB)

1 Like