dsmrreader / dsmr-reader

DSMR-telegram reader & data visualizer for hobbyists. Free for non-commercial use.
https://dsmr-reader.readthedocs.io
Other
463 stars 95 forks source link

Store and display phases consumption #161

Closed pvink closed 7 years ago

pvink commented 7 years ago

I have a suggestion to add fases. So you can see the power usage per fase. Also it would be nice if you can hang a seperate cost category on when you give power back to the grid.

Awesome software by the way!

jeroenpeters1986 commented 7 years ago

Hi pvink, just checking if you mean 'groups' by fases? The DSMR reader reads messages from the power measurement instruments, this means is is measure BEFORE the groups. So I'm not sure if that would work

pvink commented 7 years ago

My smart meter's telegram return's the current total power consumption but also seperated in 3 groups (for my case).

Is it also possible to see the power usage of the current day? Now I am only able to see the last hour from the current day.

jeroenpeters1986 commented 7 years ago

hi pvink, I think you will help Dennis a lot if you can post a few examples of the telegrams here :)

dennissiemensma commented 7 years ago

@pvink thank you for your requests. Since you are talking about three different things here, I've moved two of them to #163 and #164.

Regarding your question about phases, could you provide a bit more information? As Jeroen already suggested, a dump of your telegram might help a lot. Please be sure to remove any unique meter ID's from it before posting it here.

pvink commented 7 years ago

Thank you for splitting them. My telegram is here:

1-3:0.2.8(42) 0-0:1.0.0(161122180614W) //time notation J/M/D/U/M/S 0-0:96.1.1(lot's of numbers) 1-0:1.8.1(000150.503kWh) //total power usage 'dal' 1-0:1.8.2(000220.871kWh) //total power usage 'piek' 1-0:2.8.1(000001.694kWh) //total return power usage 'piek' 1-0:2.8.2(000003.983kWh) //total return power usage 'piek' 0-0:96.14.0(0002) //current power rate (piek/dal) 1-0:1.7.0(02.480kW) //total current power usage 1-0:2.7.0(00.000kW) //total current return power 0-0:96.7.21(00001)
0-0:96.7.9(00001) 1-0:99.97.0(1)(0-0:96.7.19)(000101000020W)(2147483647s) 1-0:32.32.0(00000) 1-0:52.32.0(00000) 1-0:72.32.0(00000) 1-0:32.36.0(00000) 1-0:52.36.0(00000) 1-0:72.36.0(00000) 0-0:96.13.1() 0-0:96.13.0() 1-0:31.7.0(000A) 1-0:51.7.0(011A) 1-0:71.7.0(000A) 1-0:21.7.0(00.016kW) //current power usage - group 1 1-0:41.7.0(02.455kW) //current power usage - group 2 1-0:61.7.0(00.009kW) //current power usage - group 3 1-0:22.7.0(00.000kW) //current return power - group 1 1-0:42.7.0(00.000kW) //current return power- group 2 1-0:62.7.0(00.000kW) //current return power- group 3 0-1:24.1.0(003) //gas valve position 0-1:96.1.0(XXXX) //id gasmeter 0-1:24.2.1(161122180000W)(00184.342*m3) //last transmitted gas usage to company !E4FE

My english very very bad at the moment, I hope you get it what I mean.

dennissiemensma commented 7 years ago

Thank you for your input. Now I see what you are pointing at.

That piece of information is currently discarded by the application because it wasn't used as input for storing and graphing the data.

For now I'll move your request to the backlog, as I think your other two requests will help a whole lot of other users. I'm not sure whether and when I can implement the phases, as it also required a lot of data migrations and additional graphs. On hold for now.

Jeltel commented 7 years ago

I'm also very interested in power usage of the phases. Always good to be able to see if one of the phases is being over used.

dennissiemensma commented 7 years ago

Hi, thank you for 'voting' for this feature, I've added it now to the v1.6 feature list, which is currently scheduled for February.

JeroenTielen commented 7 years ago

Thanks Dennis for adding this in the 1.6v. I'm also very interrested to see this as I'm also having this 3 phases setup at home.

Great software btw, much appreciated.

dennissiemensma commented 7 years ago

Hi @pvink / @Jeltel / @JeroenTielen, maybe you guys could elaborate a bit on what kind of info you are expecting.

Would it suffice to just see the recent phase(s) usage on the dashboard plotted in a graph? Possibly combined with #164 to increase the time range displayed there a bit.

Jeltel commented 7 years ago

Thats pretty much it for me. Maybe save the max value and time per phase.

For me it's to check if one of the phases is maxed out. Maybe I'll switch some groups to another phase if needed.

JeroenTielen commented 7 years ago

That would work for me as well. Maybe a checkbox so you can switch between combined or per phase during viewing (if that is possible)

pvink commented 7 years ago

Basically what Jeltel and JeroenTielen are saying. If you can catch the value or the option is enabled ( just like you did on the gas, weather and return energy) you can show it in a different graph. So with 3 phases a graph for each and a graph for total consumption on the top?

Even the 'return energie' can be splitted when you look at my telegram. Now you are doing 'energy consumpton' minus 'generated energy'..which resulsts in a - or + value and thus you can't see your actual generated power/power consumption.

So my telegram shows 6 different power consumption numbers

  1. Total power consumption since installation of the meter of the day usage
  2. Total power consumption since installation of the meter of the night usage
  3. Current power consumption at this moment. It has another line which shows if it is day or night power consumption.
  4. Current power consumption phase 1
  5. Current power consumption phase 2
  6. Current power consumption phase 3

The above also counts for generated power. So in total there are 12 different value's. It is a lot, haha.

My personal advice is that you leave the 3 phases as it is and just focus on splitting the power consumption and the generated power.

Can't wait for the next update 👍

dennissiemensma commented 7 years ago

Hi guys, I finished a proof of concept yesterday regarding plotting the phases in a graph.

Below is a screenshot where I triggered multiple phases shortly:

screenshot from 2016-12-21 19-18-03

It this were you are looking for?

dennissiemensma commented 7 years ago

@pvink I'm not sure whether your "So my telegram shows 6 different power consumption numbers" fits in here. And I'm having trouble to understand your expectations regarding that.

Just so you know:

So please clarify. :]

The only thing I can do here as well, is to store and plot the 'return' phases (P-) similar to the example above.

Jeltel commented 7 years ago

That's great Dennis. You can see the wattage on every phase and the total. Al great. And the feature to scroll back a week is very welcome as well.

Next is the max value for one phase. So you can check if you need to redistribute the electrical devices.

dennissiemensma commented 7 years ago

@Jeltel thank you for your feedback. One more question:

As for your other request, I do not see a fit for displaying the max value of a phase, because it will keep displaying the (old) highest value after redistributing. And make stuff more complex as well.

However, that does not mean that I cannot provide you the information you ask for. You can easily query the database for the information you are looking for, with a one liner.

sudo -u postgres psql dsmrreader -c "select read_at, phase_currently_delivered_l1 from dsmr_consumption_electricityconsumption where phase_currently_delivered_l1 is not null order by phase_currently_delivered_l1 desc limit 5;"

And display (fake 'old' data here):

        read_at         | phase_currently_delivered_l1 
------------------------+------------------------------
 2016-11-19 18:39:00+01 |                        4.105
 2016-10-27 17:00:00+02 |                        3.803
 2015-12-20 17:07:00+01 |                        3.799
 2016-08-19 21:15:00+02 |                        3.710
 2015-12-20 17:05:00+01 |                        3.701

sudo -u postgres psql dsmrreader -c "select read_at, phase_currently_delivered_l1 from dsmr_consumption_electricityconsumption where read_at::text > '2016-12-01 00:00:00' and phase_currently_delivered_l1 is not null order by phase_currently_delivered_l1 desc limit 5;"

Which will ignore anything before that moment picked:

        read_at         | phase_currently_delivered_l1 
------------------------+------------------------------
 2016-12-12 17:33:00+01 |                        3.513
 2016-12-14 22:09:00+01 |                        3.053
 2016-12-14 22:08:00+01 |                        3.035
 2016-12-14 22:10:00+01 |                        3.019
 2016-12-05 17:34:00+01 |                        2.872

So by the time this is released, and you have recorded the data you are looking for, I can surely help you with that.

Edit: Added phase_currently_delivered_l1 is not null condition

dennissiemensma commented 7 years ago

This ticket is the last one regarding a (new) feature for the upcoming release. It would be a shame if it get's postponed after all.

Just let me know whether you guys think this needs more reworking before merging it into the next release...

JeroenTielen commented 7 years ago

No comment from me. This looks perfect. Love the seperation in graphs from total and the phases.

Thumbs up.

Jeltel commented 7 years ago

I don't have panels either. Only reason to use it is where you have a lot of panels and are able to get more than the allowed amperage out of the panels. If so, you have a hell of an installation and already should have thought of it.

So no, I don't think it really adds something.

dennissiemensma commented 7 years ago

Thanks for your input guys. Then I will merge this for the upcoming release, as is.

dennissiemensma commented 7 years ago

The test seem to pass (after a translation fix), so merged back to development now.

Also deployed successfully here.

Jeltel commented 7 years ago

Very nice. After turning it on, you'll have to wait a bit for readings to turn up. Otherwise great! Gives even more insight on your usage :)

dennissiemensma commented 7 years ago

Great, keep this comment in mind when you want to check the peaks of each phase.

dennissiemensma commented 7 years ago

@pvink / @JeroenTielen the v1.5 release is out, containing this issue.

Please mind:

Also note that upgrading requires you to cd into the project root and activate the VirtualEnv, after switching to the dsmr user. The installation guide hinted that before, but it's highlighted more clearly now.

JeroenTielen commented 7 years ago

Hi Dennis, got it up and running. But I need to click on "Display Electric Phases" every time to display the graph. I didn't found any configuration setting to always display this.

Can it be another feature request to always display the graph? ;) (So no extra click is involved)

dennissiemensma commented 7 years ago

@JeroenTielen great to hear.

Would you mind creating a new issue for your request? The current issue is closed/completed/merged.