My Electric Time Of Use App For Economy 10

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?

No only the last 24h option thats true.

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!

2 Likes

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.

Just noticed the power view in your app @Greebo, amazing!

1 Like

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 :slight_smile:

@TrystanLea just noticed that you have pushed the changes for these apps into emoncms.org my app isn’t working as it also needs the change to the emoncms core for the “https://emoncms.org/feed/data.json” calls

Is it possible to add/remove tariffs to the Cost Comparison app?

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 :slight_smile:

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.

This will switch you to master branch for just the app folder:

cd /var/www/emoncms/Modules/app
git checkout master

Yes, but you will have to modify the javascript file on the PI - perhaps you can submit your changes back to the project via github afterwards?

The github file is located here

https://github.com/emoncms/app/blob/master/lib/costcomparison_rates.js

There are comments in the script to indicate whats going on, let me know how you get on

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?