chomupashchuk / ariston-remotethermo-home-assistant-v2

Ariston NET remotethermo integration for Home Assistant based on API
MIT License
90 stars 22 forks source link

Today energy usage stats #47

Open HausnerR opened 2 years ago

HausnerR commented 2 years ago

Hey, First, thanks @chomupashchuk for your work :)

I want to use energy stats in energy gas dashboard but they are broken. This is example from last two days:

Zrzut ekranu 2022-08-29 o 23 40 17

Ignore little gap - network issue.

Stats are collected by ariston every two hours. I found that for every odd hour some number is added (looks random?) So at 1am 28 aug was 8.22kWh, 29 aug was 7.81kWh. Then every two hours stats are higher by this number.

Additionaly really often sensor value goes to zero.

HausnerR commented 2 years ago

Ok, its not random number. Its difference between energy usage value at 22:00 and 00:00. So looks like some miscalculation.

chomupashchuk commented 2 years ago

My boiler does not provide energy use, values were somewhat assumed/calculated based on data from others.

Value 0 is probably simpler to assume the reason - there were cases in past when Ariston sometimes reported all values as 0 and a workaround was to ignore such data if non-zero values were present from previous report.

I have no idea how calculations should work. I only see data as bunch of values like {"k":10,"p":1,"v":[0.0,1.858,0.0,0.0,0.0,0.0,0.0,2.45,0.0,0.0,1.802,0.0,0.0,3.577,0.0,0.0,0.0,0.0,1.825,0.0,1.763,0.0,0.0,1.191]} where values seem to be values in 2 hour periods from each even hour period starting from right side from current hour and does not include current not-complete period (at least that seemed like the case for days or months). But if values jump every odd hour to reduce the resulting value - that is even more strange (unless last value is for the last hour or something).

Since my boiler reports always 0 I'm not sure how data splitting should look like as it does require some observation and data comparison. One of the approaches is to log energy reported data (e.g. include after self._energy_use_data = copy.deepcopy(resp.json()) a self._LOGGER.warn(self._energy_use_data) and make sure that spaces are used instead of tabs in ariston.py) and then based on data from Ariston and values in application and HA try to determine how calculation should look like.

chomupashchuk commented 2 years ago

the data from requests needs to be comared during at least 1 odd and 1 even hour and I'm not sure how hata is changed at 00 hour, but maybe that is for another time.

chomupashchuk commented 2 years ago

maybe try changing following:

            if this_hour % 2 == 1:
                # odd value means we calculate even value and add 2 hours due to following decrease
                this_2hour = (this_hour // 2) * 2 + 2
            else:
                # we assume that previous 2 hours would be used
                this_2hour = this_hour

to:

            if this_hour % 2 == 1:
                # odd value means we calculate even value and add 2 hours due to following decrease
                this_2hour = (this_hour // 2) * 2 + 2
            else:
                # we assume that previous 2 hours would be used
                this_2hour = this_hour + 2

And let me know if it removes tha reduction of values

chomupashchuk commented 2 years ago

prototype included in 2.0.12. Please provide a feedback

HausnerR commented 2 years ago

Thanks, I changed code and added logger line.

So I wait, check values now and send you log if anything will be wrong.

Thanks again!

chomupashchuk commented 2 years ago

Is the latest version working better?

HausnerR commented 2 years ago

Hey, it's much better now but still sometimes little bug:

Zrzut ekranu 2022-09-5 o 18 37 51

but to be clear I only changed code based on your tips. Newer released version does not work for me (some configuration problem probably related with multizones?)

chomupashchuk commented 2 years ago

New version should be compatible with existing configuration, the main difference is new entities names related to CH (include "_zone1"). The way HA works the not available old entities have to be manually removed and in front-end and automation entities have to be renamed. Not all CH entities affected.

HausnerR commented 2 years ago

I can't get it to work.

My config:

ariston:
  username: "kuba@pachciarek.pl"
  password: ""
  name: Ariston Osiedlowa
  sensors:
    - ch_set_temperature
    - ch_detected_temperature
    - dhw_set_temperature
    - dhw_storage_temperature
    - ch_flow_temperature
    - pressure
    - outside_temperature
    - errors_count
    - signal_strength
    - ch_energy_today
    - dhw_energy_today
  binary_sensors:
    - online
    - flame
    - ch_flame
    - dhw_flame
    - dhw_thermal_cleanse_function

I tried to add num_ch_zones: 1, changed names of ch_flame to ch_flame_zone1 (same with ch_set_temperature and ch_detected_temperature) but nothing works.

With config like above i get:

2022-09-06 01:15:27.525 ERROR (MainThread) [homeassistant.setup] Error during setup of component ariston
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/ariston/__init__.py", line 229, in setup
params = {*sensors, *binary_sensors, *switches, *selectors}.intersection(ZONED_PARAMS)
TypeError: 'NoneType' object is not iterable
chomupashchuk commented 2 years ago

try 2.0.13

HausnerR commented 2 years ago

Works, thanks! I still look for stats and give information if everything is fine.

Thanks!

Ric199021 commented 1 year ago

Hi, thanks for your work I'm facing the same issue here: image Also I've tried to use Ariston heating energy this year but there are some problems also. image

If you add this data into the Energy Dashboard you will get wrong information.

I'm using latest version available 2.014.

Ric199021 commented 1 year ago

Any news with this? Currently I'm storing the data on a separate variable based on specific time: 0:30 1:30 2:30 . . 23:30 To avoid that dropping rising problem

32Dexter commented 3 months ago

Good morning, excuse my ignorance. I am getting acquainted with this energy system these days and I can't understand the data resets at a strange time (I notice them around 04:00, I live in Italy). I would like to understand how to fix this problem. I am asking for your help also because I have connected this sensor to the energy statistics and the graph is even showing negative values. statistiche This is the image from 27.05.2024: 27 05 This is the image from today, 28.05.2024: 28 05 How can I fix this problem? Thank you very much.