My Electric Time Of Use App For Economy 10

Thanks, that’s exactly the sort of pointers I was hoping for!
I can now see clearly what is being done and where.

If I come up with something useful, should I fork the Github repo and then submit a PR or is there another mechanism?

Yes a github pull request would be great!

Trystan

For the purposes of others who might come across this thread in future, one small correction to the example provided by @TrystanLea:

Should actually be:

[[timestamp,[split1,split2,split3]],[timestamp,[split1,split2,split3]],[...

(EDIT: added code tags once I figured out the right way to do it!)

or should that be "split2" in each case?

Thanks Robert, yes it should have been and I’ve now corrected my post…
Variable names aside, the significant difference was there is an additional array in the returned results that wasn’t in TrystanLea’s example. That had me confused until I manually ran the FEED API call based on his example in the previous post. The code referred to a 3 dimensional array and I initially couldn’t work out where the third dimension came from.
The documentation for that particular FEED API doesn’t exist on my local emoncms instance so it took a little while to figure this all out.

No disrespect to the great work you guys have done, I just thought I’d correct the details here to save someone else having to work it out the same way I did.

IMHO, The only thing worse than no information is incorrect information.

Don’t get me wrong - I was pointing it out only so that somebody who copied and pasted and didn’t spot the typo wouldn’t call you all the names under the sun.

Funny you should say that. Only earlier today (or maybe late yesterday for you), this post appeared.

I’ve been saying (privately) for a long while that good and complete documentation would dramatically reduce the numbers of repetitive questions on this forum, but unfortunately, documentation isn’t ‘cool’, it’s a good chunk of the 99% perspiration that follows the 1% inspiration.

Hello @Greebo @Robert.Wall I dont think we will ever achieve perfect documentation, we have worked really hard on this over the years and in particular the last year. We do think documentation is important and certainly don’t view it as ‘uncool’.

@greebo sorry about the mistake with the array brackets, thanks for adding the clarification, I will amend my post too

@TrystanLea, all good! I don’t want anyone to think I don’t really appreciate the assistance so far. I really do!

I’ve got an updated app working showing me my three different tiers. I’m using hard-coded splits at the moment (baby steps!). The next step is to add in the weekend/public holiday handling, then dig into how the config settings are determined/stored/requested.

I’ve still got some way to go on this before you’ll be seeing a PR for the new App, but while I’m going through adding comments and changing things, I’ll see if I can retrofit those comments back into your “Development: Time of use” App and PR those if you think that is worth doing.

Your handful of pointers above really gave me the jump-start I was after.

Thanks @Greebo, I’ve just spotted this pull request from Stuart Pittaway from last night, it sounds like your working on similar goals and might be worth comparing notes?: New App - Cost Comparison by stuartpittaway · Pull Request #32 · emoncms/app · GitHub

Absolutely! That looks very much like where I was heading, I’ll definitely take a look.

Thanks for pointing it out.

I’ve had a look at the costcomparison app from Stuart and it has a completely different focus to what I was planning. He has however solved some of the same problems I was about to deal with so it was very timely that I have seen his work now :slight_smile:

I’m not sure I’ll take the same approach but it has given me plenty to think about.

1 Like

Great, Different app implementations are always welcome, let us know how you get on!

Ok, I’ve made plenty of progress with this, anyone who’d like to take a look is welcome to grab a copy from:
https://github.com/greeebs/emoncms-app.git. make sure you grab the “tou_au” branch.

There’s still a bug to fix in the “hover” when clicked through to the powergraph (the same bug is in the timeofuse.php App that I started with) and I haven’t catered for public holidays yet.

What it does do:
Allows you to define any number of individual tariff Tiers (specify Name and price)
Allows you to define the daily start times for each tariff tier for both weekdays and weekends. (It assumes the start times for each tariff are identical each weekday and identical each weekend day)
Switching to Cost mode displays a bar graph of the cost split between tiers instead of the power use split.

Clicking through to the power graph also shows the different tiers as different colours (using the same tier colours in the daily use graphs)

Feedback would be most appreciated before I submit a PR.

@Westerner, this may do what you were asking when you started this thread?

1 Like

Wow nice work! looks really nice, here’s a screen for others interested:

Very minor heading fix I think for “Weekend Tier Start Times” should be “Public holidays”? Happy to merge pull request

Cool, I’ll try and get the public holiday handling sorted tonight, fix that heading change and then submit the PR.

Appreciate the feedback.

I have downloaded the zip file from Greebo’s fork: do I just copy all the files over to the app directory on my emonpi? Apologies for the question, but I have not found an answer elsewhere.

I’ve fixed the public holiday handling and submitted a PR.

@Westerner, if @TrystanLea is happy with the PR and merges it, you should just be able to do a regular update from the web interface. Just unzipping your download into the app folder will certainly allow you to play with the new app in the meantime, but I’m not sure what that will do to future updates (I’m not familiar enough with Git to work that out!)

If you don’t want to wait, I suggest you grab the zip again now though as I’ve only just fixed a few annoying things (and added the public holiday handling).

I hope you find it useful!

My next task will be to add another App that adds a Controlled Load feed (off-peak hot water) to the Time of Use feed.

1 Like

Ok, thanks. I will await the merge … The screenshot Trystan put up looks good!

@Greebo, while awaiting the merge, would you mind educating me on how to preview your app, given that I have downloaded the zip file? I have Windows and Ubuntu machines. Many thanks.