GithubHelp home page GithubHelp logo

Comments (33)

Kuschla avatar Kuschla commented on July 22, 2024 2

@reox , @DarwinsBuddy BRAVO! Congrats for 1.1.0 Release - now, using the Statistics Sensor, I can also see the Fed-in Energy in the Energy Dashboard. You're marvels guys - excellent work!
image
I believe that this issue could be closed.

from wienernetzesmartmeter.

MatthiasRei avatar MatthiasRei commented on July 22, 2024 1

Hi,

Here my anonymized data:

consumptions

{ "consumptionYesterday": { "value": 1651, "validated": true, "date": "2023-02-08T23:00:00.000Z" }, "consumptionDayBeforeYesterday": { "value": 471, "validated": true, "date": "2023-02-07T23:00:00.000Z" } }

zaehlpunkte

[ { "bezeichnung": "fdgfdgggfhf", "geschaeftspartner": "123433338", "zaehlpunkte": [ { "zaehlpunktnummer": "AT0010000000000000001000005780222", "customLabel": null, "equipmentNumber": "900084333", "geraetNumber": "LGZ10307573167875", "isSmartMeter": true, "isDefault": false, "isActive": true, "isDataDeleted": false, "isSmartMeterMarketReady": true, "dataDeletionTimestampUTC": null, "verbrauchsstelle": { "strasse": "Straße", "hausnummer": "1", "anlageHausnummer": "1", "postleitzahl": "2300", "ort": "Beispielort", "laengengrad": "16.476290435326", "breitengrad": "48.344939098773" }, "anlage": { "typ": "TAGSTROM" }, "vertraege": [ { "einzugsdatum": "2020-12-08", "auszugsdatum": null }, { "einzugsdatum": "2008-03-01", "auszugsdatum": "2020-12-07" } ], "idexStatus": { "granularity": { "status": "QUARTER_HOUR", "canBeChanged": true }, "customerInterface": { "status": "active", "canBeChanged": true }, "display": { "isLocked": true, "canBeChanged": true }, "displayProfile": { "canBeChanged": true, "displayProfile": "VERBRAUCH" } }, "optOutDetails": { "isOptOut": false }, "zpSharingInfo": { "isOwner": false } }, { "zaehlpunktnummer": "AT0010000000000000001000015153333", "customLabel": null, "equipmentNumber": "900084888", "geraetNumber": "LGZ10307573162334", "isSmartMeter": true, "isDefault": true, "isActive": true, "isDataDeleted": false, "isSmartMeterMarketReady": true, "dataDeletionTimestampUTC": null, "verbrauchsstelle": { "strasse": "Straße", "hausnummer": "1", "anlageHausnummer": "1", "postleitzahl": "2300", "ort": "Beispielort", "laengengrad": "16.476290435326", "breitengrad": "48.344939098773" }, "anlage": { "typ": "BEZUG" }, "vertraege": [ { "einzugsdatum": "2020-12-08", "auszugsdatum": null }, { "einzugsdatum": "2013-03-26", "auszugsdatum": "2020-12-07" } ], "idexStatus": { "granularity": { "status": "DAY", "canBeChanged": true }, "customerInterface": { "status": "active", "canBeChanged": true }, "display": { "isLocked": true, "canBeChanged": true }, "displayProfile": { "canBeChanged": true, "displayProfile": "VERBRAUCH" } }, "optOutDetails": { "isOptOut": false }, "zpSharingInfo": { "isOwner": false } } ] } ]

meterReadings

{ "meterReadings": [ { "value": 978830, "type": "1-2:2.8.0", "validated": true, "date": "2023-02-09T23:00:00.000Z" } ] }

verbrauchRaw?dateFrom

{ "quarter-hour-opt-in": true, "values": [ { "value": 140, "timestamp": "2023-02-02T23:00:00.000Z", "isEstimated": false }, { "value": 824, "timestamp": "2023-02-03T23:00:00.000Z", "isEstimated": false }, { "value": 1241, "timestamp": "2023-02-04T23:00:00.000Z", "isEstimated": false }, { "value": 564, "timestamp": "2023-02-05T23:00:00.000Z", "isEstimated": false }, { "value": 1192, "timestamp": "2023-02-06T23:00:00.000Z", "isEstimated": false }, { "value": 471, "timestamp": "2023-02-07T23:00:00.000Z", "isEstimated": false }, { "value": 1651, "timestamp": "2023-02-08T23:00:00.000Z", "isEstimated": false } ], "statistics": { "maximum": 1651, "minimum": 140, "average": 869 } }

from wienernetzesmartmeter.

reox avatar reox commented on July 22, 2024 1

That probably depends how you want to integrate that... I guess it makes sense to have two sensors for that, right? Then it would probably be possible to re-use the same code even?

from wienernetzesmartmeter.

Kuschla avatar Kuschla commented on July 22, 2024 1

I would like to keep it open, unless the "live" sensor also works. Can you confirm? otherwise I'd like to investigate this.

The live Sensor doesn't have data yet

from wienernetzesmartmeter.

Alfred99-HA avatar Alfred99-HA commented on July 22, 2024 1

Thanks for quick response. At first , I couldn't get it to work. wnsm Integration did not report Update, I redownloaded v1.1.0, added integration and restarted HA.
Actually after I removed section specifing sensor in configuration-yaml. it did work fine.
Thanks a lot - hopefully statistics will be available for both "Zählpunkte" tomorrow as well

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

What we would need is potential additional calls in the smartmeter dashboard of Wiener Netze, which may not appear on a an account not owning a PV counter.

Best way to get this:

  1. access&login https://smartmeter-web.wienernetze.at/#/welcome
    welcome page

  2. Hit F12, select Network, Disable cache, filter for Fetch/XHR calls and reload the tab.
    calls

  3. select and copy the response from all of the above marked calls and paste them here (anonymized) respectively. (If you have privacy concerns, we can share them on another channel, just contact me via email)
    call

  4. If there are other calls that you don't see in above screenshot please also post them with their respective responses. (Maybe we don't have all information necessary for feeding the PV sensor).

Thanks a lot for the effort.

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

zaehlpunkt seems to return the same as for a TAGSTROM meter, just anlage.typ is different, namely BEZUG
and its idexStatus.granularity.status is DAY (I guess you cannot enable QUARTER_HOUR for this type @MatthiasRei, right?)
wnsm_pv

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

it seems that the smartmeter web UI is only invoking calls for the "default" smartmeter, i.e. your TAGSTROM meter.
So the payloads provided (except zaehlpunkt) are only for that one.

@MatthiasRei
If you're on linux could you try out to get the payloads for following calls by following before mentioned steps, but for the calls consumptions meterReadings verbrauchRaw

  1. right click onto the entry in the Network tab (the red boxed ones)
  2. select copy as cURL
  3. paste it in a terminal
  4. replace AT0010000000000000001000005780222 with AT0010000000000000001000015153333 in the URL
  5. execute and paste the response here once more?

If that's not possible and you don't have the possibility under your OS, please let me know.

Thanks in advance for your assistance

from wienernetzesmartmeter.

MatthiasRei avatar MatthiasRei commented on July 22, 2024

zaehlpunkt seems to return the same as for a TAGSTROM meter, just anlage.typ is different, namely BEZUG and its idexStatus.granularity.status is DAY (I guess you cannot enable QUARTER_HOUR for this type @MatthiasRei, right?)

@DarwinsBuddy
correct. it is not possible to enable QUARTER_HOUR for BEZUG.
image

from wienernetzesmartmeter.

MatthiasRei avatar MatthiasRei commented on July 22, 2024

@DarwinsBuddy
consumptions
{"consumptionYesterday":{"value":1209,"validated":true,"date":"2023-02-11T23:00:00.000Z"},"consumptionDayBeforeYesterday":{"value":656,"validated":true,"date":"2023-02-10T23:00:00.000Z"}}

meterReading
{"meterReadings":[{"value":982290,"type":"1-2:2.8.0","validated":true,"date":"2023-02-12T23:00:00.000Z"}]}

verbrauchRaw
TAGSTROM
{"quarter-hour-opt-in":true,"values":[{"value":564,"timestamp":"2023-02-05T23:00:00.000Z","isEstimated":false},{"value":1192,"timestamp":"2023-02-06T23:00:00.000Z","isEstimated":false},{"value":471,"timestamp":"2023-02-07T23:00:00.000Z","isEstimated":false},{"value":1651,"timestamp":"2023-02-08T23:00:00.000Z","isEstimated":false},{"value":1595,"timestamp":"2023-02-09T23:00:00.000Z","isEstimated":false},{"value":656,"timestamp":"2023-02-10T23:00:00.000Z","isEstimated":false},{"value":1209,"timestamp":"2023-02-11T23:00:00.000Z","isEstimated":false}],"statistics":{"maximum":1651,"minimum":471,"average":1048}}

BEZUG
{"quarter-hour-opt-in":true,"values":[{"value":9396,"timestamp":"2023-02-05T23:00:00.000Z","isEstimated":false},{"value":6806,"timestamp":"2023-02-06T23:00:00.000Z","isEstimated":false},{"value":6998,"timestamp":"2023-02-07T23:00:00.000Z","isEstimated":false},{"value":6091,"timestamp":"2023-02-08T23:00:00.000Z","isEstimated":false},{"value":5740,"timestamp":"2023-02-09T23:00:00.000Z","isEstimated":false},{"value":6295,"timestamp":"2023-02-10T23:00:00.000Z","isEstimated":false},{"value":7603,"timestamp":"2023-02-11T23:00:00.000Z","isEstimated":false}],"statistics":{"maximum":9396,"minimum":5740,"average":6989}}

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

it seems that quarterly hour measurements are automatically turned on for BEZUG Zaehlpunkte, as it seems to be enabled for you.

the rest seems to be the same as for TAGSTROM. the only thing we may have to change is to count yield instead of consumption. I hope I can look into it pretty soon. @reox do you think this will conflict with your changes? (otherwise I'd dog into it asap)

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

I just looked into hassio integrations and probably we just have to consider BEZUG sensors as well. how your using it is the differentiator. maybe there is a way to mark those sensors somehow or rename them, but afaik we could enable them right away. but let me look into it, once I have more time :)

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

@MatthiasRei I just looked at the code and I am wondering: isn't the BEZUG sensor not already imported and you just have to declare it in your energy dashboard as a producing energy sensor instead of a consuming one?

How many entities are visible from within your integrations dashboard at wnsm?

from wienernetzesmartmeter.

MatthiasRei avatar MatthiasRei commented on July 22, 2024

@DarwinsBuddy The issue is, that only the current value from "default" smart meter ("isDefault": true) find the way into HA.

from wienernetzesmartmeter.

reox avatar reox commented on July 22, 2024

IMHO you should be able to setup a new sensor and just give it the Zählpunktnumber? But I cannot test that due to the lack of a second Zählpunkt

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

I've got an old one (which appears as disabled in my Devices list) and my current Zaehlpunkt (which is enabled and providing data).

@MatthiasRei could you look into settings -> Devices & Integrations -> under wnsm how many entities are listed there?

from wienernetzesmartmeter.

MatthiasRei avatar MatthiasRei commented on July 22, 2024

At HA I only see one entity. The Zaehlpunkt which is set at wienernetze as default.

Could it be, that there is an issue with your scripts, because with https://api.wstw.at/gateway/WN_SMART_METER_PORTAL_API_B2C/1.0/zaehlpunkte I receive both zahlpunkte where the parameters equipmentNumber and ´geraetNumber´ are the same. Only ´zaehlpunktnummer´ is different.

Sry for my "random" anonymization of these 3 parameters.

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

no worries. anonymization is important😊

usually all available sensors (active and inactive) should be imported on installation of the integration. if you don't see those right now, one reason could be that they were added to the api response after your installed this integration. I'll double check the setup process.

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

@MatthiasRei have you set it up via editing configuration.yaml or the UI?

I just realized that the former could just support one sensor. if you remove the wnsm part from your configuration and reinstall the integration you should be able to login and potentially add all sensors.

from wienernetzesmartmeter.

MatthiasRei avatar MatthiasRei commented on July 22, 2024

I did the setup via UI. Now I removed wnsm and reinstalled it. Configuration done via UI and still only 1 entity.

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

@MatthiasRei thanks for double checking.
I think I have to invest in test cases and set up a mocked API to simulate your case. Will take some time, so please be patient. :)

from wienernetzesmartmeter.

Kuschla avatar Kuschla commented on July 22, 2024

Hi, it is actually working.
I have 2 sensors and one is BEZUG

Unbenannt

It's just not showing any data - @DarwinsBuddy would it be possible to do a dummy guide on how to export which data to eventually allow you to make the API call for BEZUG Sensors?

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

thanks for picking this up once more. I've unfortunately got some personal stuff I've to take care of right now. I'll get back to you and this issue once I'll have more time at my hand.

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

@Kuschla I guess this is not what you meant, right?
#51 (comment)

from wienernetzesmartmeter.

Kuschla avatar Kuschla commented on July 22, 2024

Yeah...It's just that I'd believe I need a bit more explaination ;)

I don't know where to replace the AT* Number in the call, except on the verbrauchRAW.
The Response is below:

{"quarter-hour-opt-in":true,"values":[{"value":9854,"timestamp":"2023-03-28T22:00:00.000Z","isEstimated":false},{"value":5810,"timestamp":"2023-03-29T22:00:00.000Z","isEstimated":false},{"value":6286,"timestamp":"2023-03-30T22:00:00.000Z","isEstimated":false},{"value":23386,"timestamp":"2023-03-31T22:00:00.000Z","isEstimated":false},{"value":8576,"timestamp":"2023-04-01T22:00:00.000Z","isEstimated":false},{"value":18588,"timestamp":"2023-04-02T22:00:00.000Z","isEstimated":false},{"value":34524,"timestamp":"2023-04-03T22:00:00.000Z","isEstimated":false}],"statistics":{"maximum":34524,"minimum":5810,"average":15289}}

for consumptions and meterReadings I get the below as response:

{"Exception":"PROD API Gateway encountered an error. Error Message: Unauthorized application request. Request Details: Service - WN_SMART_METER_PORTAL_API_B2C, Operation - /zaehlpunkt/meterReadings, Invocation Time:5:39:11 PM, Date:Apr 5, 2023, Client IP - xx.xx.xx.xx, User - Default and Application:WN_SMART_METER_PORTAL_API_B2C"}

This is the Curl Copy:

`curl 'https://api.wstw.at/gateway/WN_SMART_METER_PORTAL_API_B2C/1.0/zaehlpunkt/consumptions' \

-H 'Accept: application/json'
-H 'Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,lb;q=0.6'
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJQRW1UM05SNVB1dE5VYXpYWnlXZVV6YXBIRDcxbk1uQUFRWXlPT1FmWFZNIn0.eyJleHAiOjE2ODA3MTYyOTAsImlhdCI6MTY4MDcxNTk5MCwiYXV0aF90aW1lIjoxNjgwNzE1OTg4LCJqdGkiOiI5OTIzNWVlNS01ZDlhLTQzZjYtODFhZi05Njg3ODUzZGU0MjciLCJpc3MiOiJodHRwczovL2xvZy53aWVuL2F1dGgvcmVhbG1zL2xvZ3dpZW4iLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiZTk2NzI1ODctNjFiZS00NzAwLTgwNmMtZGRiZjNiOTQxMWExIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoid24tc21hcnRtZXRlciIsIm5vbmNlIjoiZTVjZDc5NWUtM2JmZS00M2ViLTg2ZGItODZlNDE3MmZhYTE1Iiwic2Vzc2lvbl9zdGF0ZSI6ImZhNzZkNGZiLWI2NGEtNDliMi1iOTNlLTgyYTkwNzVmMDRhZCIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwczovL3NtYXJ0bWV0ZXItd2ViLndpZW5lcm5ldHplLmF0IiwiaHR0cHM6Ly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'Expires: -1'
-H 'Origin: https://smartmeter-web.wienernetze.at'
-H 'Pragma: no-cache'
-H 'Referer: https://smartmeter-web.wienernetze.at/'
-H 'Sec-Fetch-Dest: empty'
-H 'Sec-Fetch-Mode: cors'
-H 'Sec-Fetch-Site: cross-site'
-H 'User-Agent: xxx
-H 'X-Gateway-APIKey: xxx'
-H 'sec-ch-ua: "xxx";v="111"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "xxx"'
-H 'sec-gpc: 1'
--compressed`

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

Wow! :) Thanks @Kuschla for letting us know right away.

I would like to keep it open, unless the "live" sensor also works. Can you confirm? otherwise I'd like to investigate this.

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

Then let's take care of that in this ticket :)

from wienernetzesmartmeter.

K1ngjulien avatar K1ngjulien commented on July 22, 2024

now, using the Statistics Sensor

I just added the wnsm addon to my home assistant and reading the current count works fine, but the "statistics" sensor seems to be empty.
does it just take a while for that to update? is it just updated when the smart meter does its daily upload of data?

image

from wienernetzesmartmeter.

mr-p666 avatar mr-p666 commented on July 22, 2024

The first run will take a while and when you add statistics to your energy dashboard it should show you everything you can see on WN's online portal. Usually everything up to the current day.

from wienernetzesmartmeter.

Alfred99-HA avatar Alfred99-HA commented on July 22, 2024

Actually I am inested in accessing both my "Zählpunkte" as well. This is actually my earlier existing "TAGSTROM" and my new one "BEZUG" (which stand for Feed In).
I manage to configure either one of both, but not both at a time. This might be my Problem not knowing how to configure both device_IDs. Writing both results in just overwriting the first one with the second one.

Thus I can get either Zählerstand for the one or the other Zählpunkt. For Statistics however it shows "unknown" for "BEZUG" (Feed In) and I don'T know how to get the card into the Energy board or otherwise get the "Energy usage" card for statistics onto another board.

Actually I read related items in this discussion #18 #126 #146 #51 but could not draw a conclusio.

Help would be pretty much appreciated and I offer to help document the solution

from wienernetzesmartmeter.

Kuschla avatar Kuschla commented on July 22, 2024

add the integration again, without removing the initial installation. you will now see 4 entities. 1 will have the feed-in, including statistics, one the consumption point. 2 will show no statistics.
image

from wienernetzesmartmeter.

Alfred99-HA avatar Alfred99-HA commented on July 22, 2024

Really working smoothly, nice statistics diagram in Energy board
grafik

Thanks again

from wienernetzesmartmeter.

DarwinsBuddy avatar DarwinsBuddy commented on July 22, 2024

Awesome! It works :) I'll close this issue then. Feel free to open a new one if you encounter any issues. ❤️

from wienernetzesmartmeter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.