pawelhulek / pgnig-sensor

This sensor is gathering gas usage data from PGNIG ebok page.
MIT License
31 stars 8 forks source link

more sensor data #3

Closed Santanachia closed 2 years ago

Santanachia commented 2 years ago

Hi,

  1. could you add (maybe as attributes) more data? For example previous measurement, consumption in kWh.
  2. are you sure you are giving correct data? Today is 7.03, on the FV I have the reading from 4.03 and it is higher than the one shown in HA. The HA shows the previous reading of 12.01

image image

Santanachia commented 2 years ago
  1. previous measurement = Value - Wear; kWh = Value * 11.249
  2. I opened https://ebok.pgnig.pl/crm/get-all-ppg-readings-for-meter?pageSize=1&pageNumber=1&api-version=3.0&idPpg= and see the correct reading there, in HA I still have the old value
pawelhulek commented 2 years ago

Hi @Santanachia I will take a look a look over after shortly. Really appreciate your contribution ;)

pawelhulek commented 2 years ago

1.) That's a good idea to allow to see the previous measurement, however, I would like to avoid any calculations on the sensor side. It should just convert the data from PGNIG to the entity. For the rest you will be able to write your custom templates quite easily with just a wear value. Regarding consumption in Kwh is it required for the gas sensor in HA to show on the energy dashboard correctly or m3 are just fine?

2.) I am not sure why you can see the previous measurement - however, it can be due to quite a dummy algorithm implemented. I will gather more data points and sort them to find the highest value.

Santanachia commented 2 years ago
  1. if you want to collect data only about consumption, then m3 is enough, but if you want to monitor also costs, then prices are given in kWh, not in m3
  2. difficult issue, because after restarting HA I already have the correct value. Maybe a problem with the refresh rate?
pawelhulek commented 2 years ago

1.) The value of the conversion is not available through API. It is rather hard to read and parse from PDF files. However, there is a wearKWH value available on the invoices endpoint, but there is also cost. In that way, you could easily correlate the cost from the invoice with usage in m3. Do you think that would be helpful? I am asking as personally I don't have any need to track this cost.

pawelhulek commented 2 years ago

@Santanachia In this pull request I am going to add wear value to the state attributes. https://github.com/pawelhulek/pgnig-sensor/pull/5 Will that be enough or would you like to add some more details?

Santanachia commented 2 years ago

@pawelhulek, if you think there should be no computation on the integration side (which I personally disagree with), this will have to do, although I don't know what is available beyond what is in https://ebok.pgnig.pl/crm/get-all-ppg-readings-for-meter

pawelhulek commented 2 years ago

@Santanachia Please take a look at https://github.com/pawelhulek/pgnig-sensor/blob/0.1.4/custom_components/pgnig_gas_sensor/Invoices.py#L54 maybe this will give you some idea on what is available through endpoints

pawelhulek commented 2 years ago

@Santanachia Take a look at the new entity. I hope it will be helpful