The key here is that the “daily” value is the setting for the mode property, which selects the use of the get_data_DMY function, split then selects the use of the time of use version:
} else if (isset($_GET['mode'])) {
if (isset($_GET['split'])) {
$result = $feed->get_data_DMY_time_of_day($feedid,get('start'),get('end'),get('mode'),get('split'));
@Greebo. Happy to help test and comment, but my programming ability is non-existent. @Trystan In the solarpv app, is there a view that will show the current calendar day use? The D button displays the previous 24hr period (perhaps it should be named 24H, rather than D), not the current calendar day. Is this correct, or is it peculiar to my setup? Regarding Daylight Saving question, and @Greebo 's nifty Flexible Time Of Use app, it looks like some adjustment needs to be made when one starts adding in cost calculations. On the app display, for example, ideally I want to see my usage between BST 1300-1600hrs, but the cost calculation for that period needs to be made on GMT 1300-1600hrs (i.e. BST 1400-1700hrs). Is there any way of achieving this? Or would one just have to set the timezone to GMT without BST adjustment, and just live with the display being out of sync with BST?
I’ve had a few thoughts about how I might be able to get this to work but it will take a week or so for me to get the time to validate a few things and put something together.
In your example, why does the cost calculation need to be done on GMT and not BST? Or is that only because you have your profile setup to always use GMT?
@Greebo My emoncms profile is set up to adjust for BST. My electricity meter does not adjust for BST - it remains on GMT. For example, I pay a different (cheaper) rate for grid power between 1300-1600 GMT, which is 1400-1700 BST. Thus, during BST, to take advantage of this cheaper rate I have to make sure that I use the power between 1400-1700 BST. In the app, the display of BST power consumption is fine, but the cost calculation is not because that needs to be calculated based on GMT, not BST. It may be that the only solution is to set the emoncms to GMT without BST adjustment, and just live with the display being out of sync with BST. Hope this makes sense.
Ah, I see. Is that normal in the UK?
Here in Australia, the TOU billing occurs based on “current” timezone, so shoulder of 7am to 2pm is always 7 to 2 even when we switch to daylight saving.
I am not sure it is normal, but that’s the way my electricity supplier has set it up. No doubt the reasons include avoiding having power demand surges at the beginning of these cheaper rate periods, and also just to confuse customers.
My guess is it’s a carry-over from the time when they used synchronous motor mechanical time clocks to switch over, and clearly it was impractical to reset all of those twice-yearly.
@TrystanLea some of the comments above remind me that emoncms really should have a central settings for things like region, time formats, currency etc. at the moment every app appears to re-invent the wheel for this.
Additionally, feeds/inputs would be really useful to be able to allocate a “unit” label!
It does have a central area for this, it’s on the user account timezone settings.
If you use the schedule module as i recommended earlier it does have a way to deal with winter and summer time differently, or in a similar way, you configure it the way you need.
Thanks @TrystanLea, I’ve never used flot before (or jquery for that matter) so it took a bit of reading to figure out what options I had and how to do that. Its not the most efficient implementation but it is effective. It does go a bit weird if there’s missing data, I know how to fix that but haven’t been inspired to do so yet
I see that your excellent Time Of Use Flexible app is in the master branch now - £ sign working. However, if I update from EmonPi, I lose your app. @Trystan any comments?
That could be because of the changes we made for you to test it, If you’re still pointing at my git repo for that folder, it could be trying to update from there.
If you still have the backup “app” folder, try putting that back in place and doing another update. If that fails (or you don’t have the backup folder) post again and I’ll think of something else
Thanks @Greebo. It’s in the master but not the stable release - presumably the emonpi update references the stable release, not the master, hence why it disappears.
Thanks @Greebo. Would you be able to have a look at this? To see what my BST figures would look like, I created another instance of the TOU Flexible app, and put in different tier start times. I use most of my electricity during off-peak periods. Screenshots 1 and 2 use data based on the following variables:
OffPeak:0.0693,Day:0.2131
Weekday & Weekend Start Times
0:0,5:1,13:0,16:1,20:0,22:1
The screens shots show, as expected, that most of the use is in the Off-peak periods.
In the new instance of the app I changed the Start Times to reflect my use in BST:
Weekday & Weekend Start Times
1:0,6:1,14:0,17:1,21:0,23:1
(I also tried starting from 0, i.e 0:0, 6:1,… but the result is the same)
I would have expected the screenshots to show similar results to the two above, but the Day usage is greater than the Off-peak, which does not look right. I don’t think I have entered the times incorrectly, and I have checked that it is not a caching/refresh issue. Any thoughts?