Home-Assistant-custom-components-Tauron-AMIplus icon indicating copy to clipboard operation
Home-Assistant-custom-components-Tauron-AMIplus copied to clipboard

secondary energy meter

Open acuszka opened this issue 3 years ago • 15 comments

Hi Piotr,

First of all, let me say thank you for writing this integration. It worked great when I had only one energy meter. There's now a secondary energy meter assigned to my profile in eLicznik. I want to display the data only for the secondary meter. I modified config.yaml with the new energy_meter_id, and restarted HA, but it still pulls the information for the primary meter.

acuszka avatar May 21 '22 14:05 acuszka

Do you have the latest version of the integration installed?

PiotrMachowski avatar May 21 '22 18:05 PiotrMachowski

Yes, I have the newest version.

image

acuszka avatar May 23 '22 06:05 acuszka

I have the same problem, or I'm using the wrong id.... I copy pasted the value from dropdown, which is the 18 digits number. Still, the values for the first meter are extracted

grest avatar Aug 15 '22 18:08 grest

I solved it! I've opened the developer tools, and copy pasted the value ofthe 'valute' attribute within the

grest avatar Aug 15 '22 18:08 grest

Maybe your solution is the same? @tacuszka

PiotrMachowski avatar Aug 15 '22 19:08 PiotrMachowski

I solved it! I've opened the developer tools, and copy pasted the value ofthe 'valute' attribute within the html tag.

I don't see 'valute' attribute in dev tools. Did you mean the 'value' attribute? The one with the underscores on the image below? (<option value = "5xxx_6xxxx_6xxxx)

image

acuszka avatar Aug 15 '22 20:08 acuszka

It is visible in "network" tab, in parameters of call to "charts" address

PiotrMachowski avatar Aug 15 '22 20:08 PiotrMachowski

It is visible in "network" tab, in parameters of call to "charts" address

Can you give me more details on how to find it? I clicked through all the entries in the network tab, but I don't see anything I could use

acuszka avatar Aug 15 '22 20:08 acuszka

image

Open dev tools and refresh the page. A call to "charts" should be visible. The value you need is passed in dane[smartNr]

PiotrMachowski avatar Aug 15 '22 21:08 PiotrMachowski

Open dev tools and refresh the page. A call to "charts" should be visible. The value you need is passed in dane[smartNr]

We're talking about https://elicznik.tauron-dystrybucja.pl/ correct?

image

acuszka avatar Aug 15 '22 21:08 acuszka

Yup. Do you have a chart visible?

PiotrMachowski avatar Aug 15 '22 21:08 PiotrMachowski

Ok, got it. It shows up only when you open the day/month/year tab for the first time. It gives me the same value as on my first dev tools screenshot (5xxx_6xxxx_6xxxx). I already tried passing it to configuration.yaml without luck. I'll remove the Tauron integration from HA and try again.

image

acuszka avatar Aug 15 '22 21:08 acuszka

You can also try to reinstall it in HACS

PiotrMachowski avatar Aug 15 '22 21:08 PiotrMachowski

You can also try to reinstall it in HACS

Removed Tauron-AMIplus integration using HACS. I deleted all the orphaned entities. Restarted HA. Installed the integration again. No matter what I put in the energy meter ID (value visible on the page or the danepsmartNr] value), it always downloads the first energy meter data.

@grest, how did you do it? :D

acuszka avatar Aug 15 '22 21:08 acuszka

@grest ?

acuszka avatar Aug 28 '22 20:08 acuszka

Hi I have got the same issue I tried all numbers: Płatnik, Punkt poboru, nr licznika, smart_id całe i pojedyncze człony oddzielone podkreślnikami...and nothing. @tacuszka but I have found workaround - if you disable your first meter in settings (on the eliczniki web page) then HA reads the second meter. I personally do not like because my parents needs access to their data but maybe it works for you. I will be trying more but later ... Tauron has blocked my account because of too many logins ;)

lkuznicki avatar Oct 04 '22 06:10 lkuznicki

Hi I have got the same issue I tried all numbers: Płatnik, Punkt poboru, nr licznika, smart_id całe i pojedyncze człony oddzielone podkreślnikami...and nothing. @tacuszka but I have found workaround - if you disable your first meter in settings (on the eliczniki web page) then HA reads the second meter. I personally do not like because my parents needs access to their data but maybe it works for you. I will be trying more but later ... Tauron has blocked my account because of too many logins ;)

Unfortunately, I need to keep both meters available on the Tauron web portal. I need only the second one in the HA tho.

acuszka avatar Oct 05 '22 10:10 acuszka

@tacuszka, czy mógłbym Cię prosić o wsparcie? Dodałem obsługę odczytu całkowitego poboru energii (stanu licznika), ale zastanawiam się, czy to będzie działać dla wielu liczników. Czy mógłbym Cię prosić o dostarczenie mi odpowiedzi na zapytanie o stan licznika – tak, jak to opisałem tutaj? Będę wdzięczny, jeśli to nie problem. Zobaczę wtedy, jaki jest format odpowiedzi przy wielu licznikach. Dziękuję!! :)

mariusz-schimke avatar Nov 06 '22 10:11 mariusz-schimke

@grest ?

I solved it! I've opened the developer tools, and copy pasted the value ofthe 'valute' attribute within the html tag.

I don't see 'valute' attribute in dev tools. Did you mean the 'value' attribute? The one with the underscores on the image below? (<option value = "5xxx_6xxxx_6xxxx)

image

Of course, it's value attribute. Exactly as on your screenshot.

grest avatar Nov 09 '22 09:11 grest

Sorry for mixing topics here, but since you both have multiple meters, maybe you could help me find out how the data is structured when requesting readings for a specific date, @grest? I described here what I would need to handle readings of the meter that is specified in the configuration of the add on. Will be grateful, thanks!

mariusz-schimke avatar Nov 09 '22 17:11 mariusz-schimke

Sorry for mixing topics here, but since you both have multiple meters, maybe you could help me find out how the data is structured when requesting readings for a specific date, @grest? I described here what I would need to handle readings of the meter that is specified in the configuration of the add on. Will be grateful, thanks!

<div class="clear"></div>Pobór:<br /><span class="name"> <b></b> 02.11.2022 (23:59:59)</span> <span original-title="Nr licznika: N000000000000" class="value tipsyOnTop"> 002040</span><span class="unit">kWh </span><br /><div class="clear"></div><br />Oddanie:<br /><span class="name"> <b></b> 02.11.2022 (23:59:59)</span> <span original-title="Nr licznika: N000000000000" class="value tipsyOnTop"> 003040</span><span class="unit">kWh </span><br />

grest avatar Nov 10 '22 07:11 grest

Many thanks! This reading includes only one meter, though. I thought it would be a list of generations and consumptions for multiple meters. Is the meter somehow preselected on the website?

I also noticed that the meter number may contain letters, which I didn't take into consideration when formulating a regular expression.

Thanks!

mariusz-schimke avatar Nov 10 '22 07:11 mariusz-schimke

There is a dropdown on the page, which sets the page context. After value changed, the whole page is reloaded. I thought the meter id will be later on a part of a request, but unfortunately I cannot find it anywhere. I'll try again.

grest avatar Nov 12 '22 13:11 grest

Isn't it specified in the session cookie perchance?

mariusz-schimke avatar Nov 12 '22 14:11 mariusz-schimke

@tacuszka, czy mógłbym Cię prosić o wsparcie? Dodałem obsługę odczytu całkowitego poboru energii (stanu licznika), ale zastanawiam się, czy to będzie działać dla wielu liczników. Czy mógłbym Cię prosić o dostarczenie mi odpowiedzi na zapytanie o stan licznika – tak, jak to opisałem tutaj? Będę wdzięczny, jeśli to nie problem. Zobaczę wtedy, jaki jest format odpowiedzi przy wielu licznikach. Dziękuję!! :)

Do you still need this, or is @grest answer enough? I can do some quick checks if you need anything else.

acuszka avatar Nov 21 '22 05:11 acuszka

@tacuszka, thanks for asking. What I'm trying to test is whether you will always get total values from the correct meter specified in the add-on's configuration. But if the meter context (PPE?) is selected globally, then maybe there is no problem (I can't test that though).

I don't want to bother you, but if you like, you can download the version from here, and follow the steps from here. If you then get total readings from the meter you specified in the configuration, then everything probably works fine.

But no pressure, I'm pretty sure it should be working correctly. Thanks!

mariusz-schimke avatar Nov 21 '22 19:11 mariusz-schimke

@tacuszka, thanks for asking. What I'm trying to test is whether you will always get total values from the correct meter specified in the add-on's configuration. But if the meter context (PPE?) is selected globally, then maybe there is no problem (I can't test that though).

I don't want to bother you, but if you like, you can download the version from here, and follow the steps from here. If you then get total readings from the meter you specified in the configuration, then everything probably works fine.

But no pressure, I'm pretty sure it should be working correctly. Thanks!

Unfortunately, I can't install the new version manually at the moment. Can you publish it as a beta in HACS? Also, if you need to see how the Tauron portal behaves with two energy meters, I'm open for call and screen-sharing sessions.

acuszka avatar Nov 24 '22 06:11 acuszka

Oh, I'm not sure if I can do that not being an owner of this repository (I have never done that, I don't use HACS). Maybe let us wait for @PiotrMachowski to publish it when he has time to do so?

When it comes to multiple energy meters, since they are not returned all when you go to readings, but when you change the context, then you get only the readings of one associated meter, I'm pretty sure the add-on will work as expected, because you provide a PPE number in its configuration (which, I assume, represents the context). Unless you suspect it's not that simple?

mariusz-schimke avatar Dec 04 '22 21:12 mariusz-schimke

@mariusz-schimke yes, there's a request to change a context (here), unfortunately I'm not able to test it on my account

PiotrMachowski avatar Dec 04 '22 21:12 PiotrMachowski

@PiotrMachowski, thanks for your input! So it seems that we can confirm this should work as it is. Thanks for your screen sharing session offer, though, @acuszka!!

mariusz-schimke avatar Dec 04 '22 21:12 mariusz-schimke