Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during setup: TForbrugsLinje #50

Open
SirBj opened this issue Jan 11, 2023 · 10 comments
Open

Error during setup: TForbrugsLinje #50

SirBj opened this issue Jan 11, 2023 · 10 comments

Comments

@SirBj
Copy link

SirBj commented Jan 11, 2023

When adding the integration, I keep getting the same error:

(I apologise that some of the text is in danish, as it is my native language)

[Forsøger konfigurationen igen: 'TForbrugsLinje']

Some backstory:
3-4 months ago when I first tried to setup it up it was working and the sensors was created, the data was not as expected as it looked like it did not change or maybe after a day (not sure how often data is updated). But i did not have time to play with it.
Today when I had time to look into it, I got this error, I then deleted it and tried again, but without lock.

When looking in the log i find this section:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/eforsyning/coordinator.py", line 55, in _async_update_data
raise ConfigEntryNotReady from error
homeassistant.exceptions.ConfigEntryNotReady: 'TForbrugsLinje'
2023-01-10 20:14:41.825 ERROR (MainThread) [homeassistant.components.homeassistant_alerts] Timeout fetching homeassistant_alerts data
2023-01-10 20:14:44.580 WARNING (Thread-6) [matplotlib.font_manager] Matplotlib is building the font cache; this may take a moment.
2023-01-10 20:14:56.794 ERROR (MainThread) [custom_components.eforsyning.coordinator] Unexpected error fetching eForsyning data: 'TForbrugsLinje'
Traceback (most recent call last):
File "/config/custom_components/eforsyning/coordinator.py", line 53, in _async_update_data
data = await self.hass.async_add_executor_job(self.api.get_latest)
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/eforsyning/pyeforsyning/eforsyning.py", line 365, in get_latest
result = self._parse_result_heating(raw_data)
File "/config/custom_components/eforsyning/pyeforsyning/eforsyning.py", line 419, in _parse_result_heating
for fl in result['ForbrugsLinjer']['TForbrugsLinje']:
KeyError: 'TForbrugsLinje'

I think that this is refers to part of the code, getting the data but I am not sure.

I am still a noob in HomeAssistant, if some other information is need I will be happy to provided it.

@kpoppel
Copy link
Owner

kpoppel commented Jan 11, 2023

Try to update the integration first. This code does not exist from version 1.1.0 forward. the latest released is v1.1.4 with v1.1.5 as pre-release.

If the issue persists, please turn on debug information as specified in the README file and dump the log here (make sure personal information like username and password is not transmitted onto the Internet).

@SirBj
Copy link
Author

SirBj commented Jan 17, 2023

Thank you for you fast responce.

I have now updated the the integration, I could not find it other than thrugh HACS (hope that is the correct way)

I have only added some of the log file as it is 18000 lines, which I have to go thrugt removing personal data.
this is the last lines, which for me looks like data is comming, but then it stops with some error.

2023-01-17 19:35:52.931 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Parsing results - IaltLinje for non-day data.
2023-01-17 19:35:52.931 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Getting time series
2023-01-17 19:35:52.931 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] POST data to API. {'Ejendomnr': 'USER', 'AktivNr': '2', 'I_Nr': '1', 'AarsMaerke': 2022, 'ForbrugsAfgraensning_FraDato': '0', 'ForbrugsAfgraensning_TilDato': '0', 'ForbrugsAfgraensning_FraAflaesning': '0', 'ForbrugsAfgraensning_TilAflaesning': '2', 'ForbrugsAfgraensning_MedtagMellemliggendeMellemaflas': 'false', 'Optioner': 'foBestemtBeboer, foSkabDetaljer, foMedtagWebAflaes', 'AHoejDetail': 'false', 'Aflaesningsfilter': 'afMaanedsvis', 'AflaesningsFilterDag': 'ULTIMO', 'AflaesningsUdjaevning': 'false', 'SletFiltreredeAflaesninger': 'true', 'MedForventetForbrug': 'true', 'OmregnForbrugTilAktuelleEnhed': 'true'}
2023-01-17 19:35:53.173 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Done getting time series 200, Body: {
"ForbrugsLinjer": {
"AktuelLinjeNr": "1",
"AntLinjer": "2",
"TForbrugsLinje": [
{
"TempRetur": "0",
"Afl_Nr": "180294",
"AntTaellevaerker": "3",
"TilDatoStr": "30-11-2022",
"Art": "0",
"STAflType": "60",
"Lbnr_andet": "1",
"Mell_AflNr": "913",
"TForbrugsTaellevaerk": [
{
"IndexNavn": "M3",
"Enhed_Txt": "M3",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "1",
"Faktor": "1",
"Slut": "2026,36",
"Start": "1476,44",
"Format": "####0.00",
"Forbrug": "549,92"
},{
"IndexNavn": "ENG1",
"Enhed_Txt": "KWh",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "5",
"Faktor": "1",
"Slut": "39828,00",
"Start": "29804,00",
"Format": "####0.00",
"Forbrug": "10024,00"
},{
"IndexNavn": "TIME_",
"Enhed_Txt": "Timer",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "20",
"Faktor": "1",
"Slut": "38112,00",
"Start": "30070,00",
"Format": "####0.00",
"Forbrug": "8042,00"
}],
"Elek_mtype": "0",
"LinieStatistik": {
"DiffProc": "0",
"RefEnhed": "0",
"RefTilDatoStr": "30-12-1899",
"Difference": "0",
"Forventet": "0",
"Reference": "0",
"RefFraDatoStr": "30-12-1899",
"TvNavn": ""
},
"Elek_MalNr": "69671427",
"Fiktiv": "False",
"Taellevaerker": {
"Text": "M3|ENG1|TIME_|"
},
"VarKorrigeret": "False",
"ForventetAflaesningENG1": "41248,44",
"Aflas_kilde_text": "aflæst af værket",
"Kommentar": "",
"ForventetAflaesningM3": "1722,45",
"StartaflFejlkode": "",
"Alfasog": "69671427",
"Afkoling": "15,6736194141891",
"Afl_Metode": "0",
"Lbnr_elek": "3",
"Korrig_afl_nr": "0",
"Mek_MalNr": "69671427",
"AarsMaerke": "0",
"FraDatoStr": "30-12-2021",
"Afl_Tekst": "",
"ForventetForbrugENG1": "11444,44",
"Forv_Retur": "35",
"Tempfrem": "0",
"Aflas_kilde_id": "10",
"Lbnr_mek": "3",
"ForventetForbrugFraRealiseredeGraddageFaktor": "0,855781537660388",
"Fakturanr": "0",
"Text": "M3|ENG1|TIME_|",
"Pris": "0",
"Fejlkode": "",
"AktuelTaellevaerksNr": "1",
"AflType": "30",
"JournalNummer": "0",
"HaandTermnr": "69671427",
"I_Alt_Kr": "0",
"NeutraltOmraadeOvre": "0",
"OprettetAfUdjaevningen": "False",
"EkskluderetMedFilter": "False",
"Ejd_Aktivnr": "2",
"ForventetForbrugM3": "246,01",
"NeutraltOmraadeNedre": "0"
},{
"TempRetur": "0",
"Afl_Nr": "183450",
"AntTaellevaerker": "3",
"TilDatoStr": "29-12-2022",
"Art": "0",
"STAflType": "30",
"Lbnr_andet": "1",
"Mell_AflNr": "0",
"TForbrugsTaellevaerk": [
{
"IndexNavn": "M3",
"Enhed_Txt": "M3",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "1",
"Faktor": "1",
"Slut": "2091,90",
"Start": "2026,36",
"Format": "####0.00",
"Forbrug": "65,54"
},{
"IndexNavn": "ENG1",
"Enhed_Txt": "KWh",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "5",
"Faktor": "1",
"Slut": "41721,00",
"Start": "39828,00",
"Format": "####0.00",
"Forbrug": "1893,00"
},{
"IndexNavn": "TIME_",
"Enhed_Txt": "Timer",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "20",
"Faktor": "1",
"Slut": "38808,00",
"Start": "38112,00",
"Format": "####0.00",
"Forbrug": "696,00"
}],
"Elek_mtype": "0",
"LinieStatistik": {
"DiffProc": "0",
"RefEnhed": "0",
"RefTilDatoStr": "30-12-1899",
"Difference": "0",
"Forventet": "0",
"Reference": "0",
"RefFraDatoStr": "30-12-1899",
"TvNavn": ""
},
"Elek_MalNr": "69671427",
"Fiktiv": "False",
"Taellevaerker": {
"Text": "M3|ENG1|TIME_|"
},
"VarKorrigeret": "False",
"ForventetAflaesningENG1": "42857,46",
"Aflas_kilde_text": "aflæst af værket",
"Kommentar": "",
"ForventetAflaesningM3": "1757,04",
"StartaflFejlkode": "",
"Alfasog": "69671427",
"Afkoling": "24,8354441256744",
"Afl_Metode": "0",
"Lbnr_elek": "3",
"Korrig_afl_nr": "0",
"Mek_MalNr": "69671427",
"AarsMaerke": "0",
"FraDatoStr": "30-11-2022",
"Afl_Tekst": "",
"ForventetForbrugENG1": "1609,02",
"Forv_Retur": "35",
"Tempfrem": "0",
"Aflas_kilde_id": "10",
"Lbnr_mek": "3",
"ForventetForbrugFraRealiseredeGraddageFaktor": "1,04951762127611",
"Fakturanr": "0",
"Text": "M3|ENG1|TIME_|",
"Pris": "0",
"Fejlkode": "",
"AktuelTaellevaerksNr": "1",
"AflType": "60",
"JournalNummer": "0",
"HaandTermnr": "69671427",
"I_Alt_Kr": "0",
"NeutraltOmraadeOvre": "0",
"OprettetAfUdjaevningen": "False",
"EkskluderetMedFilter": "False",
"Ejd_Aktivnr": "2",
"ForventetForbrugM3": "34,59",
"NeutraltOmraadeNedre": "0"
}],
"Text": "0|1|",
"Pris": "0"
},
"Kategorier": "",
"ITP": "0",
"AarSlut": "31-12-2022",
"Adresse": "",
"IaltLinje": {
"TempRetur": "0",
"AntTaellevaerker": "3",
"TilDatoStr": "29-12-2022",
"SidsteAflNr": "183450",
"TForbrugsTaellevaerk": [
{
"IndexNavn": "M3",
"Enhed_Txt": "M3",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "1",
"Faktor": "1",
"Slut": "2026,36",
"Start": "1476,44",
"Format": "####0.00",
"Forbrug": "615,46"
},{
"IndexNavn": "ENG1",
"Enhed_Txt": "KWh",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "5",
"Faktor": "1",
"Slut": "39828,00",
"Start": "29804,00",
"Format": "####0.00",
"Forbrug": "11917,00"
},{
"IndexNavn": "TIME_",
"Enhed_Txt": "Timer",
"Korrig": "0,00",
"Beskrivelse": "",
"Enhed": "20",
"Faktor": "1",
"Slut": "38112,00",
"Start": "30070,00",
"Format": "####0.00",
"Forbrug": "8738,00"
}],
"LinieStatistik": {
"DiffProc": "0",
"RefEnhed": "0",
"RefTilDatoStr": "30-12-1899",
"Difference": "0",
"Forventet": "0",
"Reference": "0",
"RefFraDatoStr": "30-12-1899",
"TvNavn": ""
},
"Taellevaerker": {
"Text": "M3|ENG1|TIME_|"
},
"VarKorrigeret": "False",
"Afkoling": "16,6492571349033",
"FraDatoStr": "30-12-2021",
"ForventetForbrugENG1": "26106,92",
"Forv_Retur": "35",
"AntForbrugsLinjer": "2",
"Tempfrem": "0",
"ForventetForbrugFraRealiseredeGraddageFaktor": "0",
"AntEjendomme": "0",
"AntInstallationer": "0",
"Text": "M3|ENG1|TIME_|",
"Pris": "0",
"AktuelTaellevaerksNr": "1",
"I_Alt_Kr": "0",
"NeutraltOmraadeOvre": "0",
"ForventetForbrugM3": "561,2",
"NeutraltOmraadeNedre": "0"
},
"InstDato": "35705",
"InstAdrUds": "False",
"IHusNr": "0",
"MaalAflFysNr": "",
"IVejNr": "0",
"Afk_Metode": "0",
"ILitraer": "",
"AarStart": "01-01-2022",
"PrognEng1Uds": "False",
"Vv_Proc": "25",
"PrognM3Uds": "False",
"Text": "",
"LbNr": "1",
"Afk_Graense2": "0",
"Afk_Graense1": "0"
}

2023-01-17 19:35:53.182 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Parsing results - IaltLinje for non-day data.

2023-01-17 19:35:53.184 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Getting time series
2023-01-17 19:35:53.184 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] POST data to API. {'Ejendomnr': 'USER', 'AktivNr': '2', 'I_Nr': '1', 'AarsMaerke': 2023, 'ForbrugsAfgraensning_FraDato': '0', 'ForbrugsAfgraensning_TilDato': '0', 'ForbrugsAfgraensning_FraAflaesning': '0', 'ForbrugsAfgraensning_TilAflaesning': '2', 'ForbrugsAfgraensning_MedtagMellemliggendeMellemaflas': 'false', 'Optioner': 'foBestemtBeboer, foSkabDetaljer, foMedtagWebAflaes', 'AHoejDetail': 'false', 'Aflaesningsfilter': 'afMaanedsvis', 'AflaesningsFilterDag': 'ULTIMO', 'AflaesningsUdjaevning': 'false', 'SletFiltreredeAflaesninger': 'true', 'MedForventetForbrug': 'true', 'OmregnForbrugTilAktuelleEnhed': 'true'}
2023-01-17 19:35:53.587 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Done getting time series 200, Body: {
"ForbrugsLinjer": {
"AktuelLinjeNr": "0",
"AntLinjer": "0",
"Text": "",
"Pris": "0"
},
"Kategorier": "",
"ITP": "0",
"AarSlut": "31-12-2023",
"Adresse": "",
"IaltLinje": {
"TempRetur": "0",
"AntTaellevaerker": "0",
"TilDatoStr": "30-12-1899",
"SidsteAflNr": "0",
"LinieStatistik": {
"DiffProc": "0",
"RefEnhed": "0",
"RefTilDatoStr": "30-12-1899",
"Difference": "0",
"Forventet": "0",
"Reference": "0",
"RefFraDatoStr": "30-12-1899",
"TvNavn": ""
},
"Taellevaerker": {
"Text": ""
},
"VarKorrigeret": "False",
"Afkoling": "0",
"FraDatoStr": "29-12-2022",
"ForventetForbrugENG1": "0",
"Forv_Retur": "35",
"AntForbrugsLinjer": "0",
"Tempfrem": "0",
"ForventetForbrugFraRealiseredeGraddageFaktor": "0",
"AntEjendomme": "0",
"AntInstallationer": "0",
"Text": "",
"Pris": "0",
"AktuelTaellevaerksNr": "0",
"I_Alt_Kr": "0",
"NeutraltOmraadeOvre": "0",
"ForventetForbrugM3": "0",
"NeutraltOmraadeNedre": "0"
},
"InstDato": "0",
"InstAdrUds": "False",
"IHusNr": "0",
"MaalAflFysNr": "",
"IVejNr": "0",
"Afk_Metode": "0",
"ILitraer": "",
"AarStart": "01-01-2023",
"PrognEng1Uds": "False",
"Vv_Proc": "25",
"PrognM3Uds": "False",
"Text": "",
"LbNr": "1",
"Afk_Graense2": "0",
"Afk_Graense1": "0"
}

2023-01-17 19:35:53.588 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Parsing results - IaltLinje for non-day data.
2023-01-17 19:35:53.588 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Getting time series
2023-01-17 19:35:53.589 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] POST data to API. {'Ejendomnr': 'USER', 'AktivNr': '2', 'I_Nr': '1', 'AarsMaerke': 2023, 'ForbrugsAfgraensning_FraDato': '16-01-2023', 'ForbrugsAfgraensning_TilDato': '17-01-2023', 'ForbrugsAfgraensning_FraAflaesning': '0', 'ForbrugsAfgraensning_TilAflaesning': '2', 'ForbrugsAfgraensning_MedtagMellemliggendeMellemaflas': 'true', 'Optioner': 'foBestemtBeboer, foSkabDetaljer, foMedtagWebAflaes', 'AHoejDetail': 'false', 'Aflaesningsfilter': 'afDagsvis', 'AflaesningsFilterDag': 'ULTIMO', 'AflaesningsUdjaevning': 'true', 'SletFiltreredeAflaesninger': 'true', 'MedForventetForbrug': 'true', 'OmregnForbrugTilAktuelleEnhed': 'true'}
2023-01-17 19:35:53.792 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Done getting time series 200, Body: {
"ForbrugsLinjer": {
"AktuelLinjeNr": "0",
"AntLinjer": "0",
"Text": "",
"Pris": "0"
},
"Kategorier": "",
"ITP": "0",
"AarSlut": "31-12-2023",
"Adresse": "",
"IaltLinje": {
"TempRetur": "0",
"AntTaellevaerker": "0",
"TilDatoStr": "30-12-1899",
"SidsteAflNr": "0",
"LinieStatistik": {
"DiffProc": "0",
"RefEnhed": "0",
"RefTilDatoStr": "30-12-1899",
"Difference": "0",
"Forventet": "0",
"Reference": "0",
"RefFraDatoStr": "30-12-1899",
"TvNavn": ""
},
"Taellevaerker": {
"Text": ""
},
"VarKorrigeret": "False",
"Afkoling": "0",
"FraDatoStr": "29-12-2022",
"ForventetForbrugENG1": "0",
"Forv_Retur": "35",
"AntForbrugsLinjer": "0",
"Tempfrem": "0",
"ForventetForbrugFraRealiseredeGraddageFaktor": "0",
"AntEjendomme": "0",
"AntInstallationer": "0",
"Text": "",
"Pris": "0",
"AktuelTaellevaerksNr": "0",
"I_Alt_Kr": "0",
"NeutraltOmraadeOvre": "0",
"ForventetForbrugM3": "0",
"NeutraltOmraadeNedre": "0"
},
"InstDato": "0",
"InstAdrUds": "False",
"IHusNr": "0",
"MaalAflFysNr": "",
"IVejNr": "0",
"Afk_Metode": "0",
"ILitraer": "",
"AarStart": "01-01-2023",
"PrognEng1Uds": "False",
"Vv_Proc": "25",
"PrognM3Uds": "False",
"Text": "",
"LbNr": "1",
"Afk_Graense2": "0",
"Afk_Graense1": "0"
}

2023-01-17 19:35:53.792 DEBUG (SyncWorker_6) [custom_components.eforsyning.pyeforsyning.eforsyning] Parsing results - heating metering

2023-01-17 19:35:53.793 ERROR (MainThread) [custom_components.eforsyning.coordinator] Unexpected error fetching eForsyning data: 'TForbrugsLinje'
Traceback (most recent call last):
File "/config/custom_components/eforsyning/coordinator.py", line 53, in _async_update_data
data = await self.hass.async_add_executor_job(self.api.get_latest)
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/eforsyning/pyeforsyning/eforsyning.py", line 432, in get_latest
result = self._parse_result_heating(day_data)
File "/config/custom_components/eforsyning/pyeforsyning/eforsyning.py", line 565, in _parse_result_heating
for fl in result['ForbrugsLinjer']['TForbrugsLinje']:
KeyError: 'TForbrugsLinje'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/eforsyning/coordinator.py", line 55, in _async_update_data
raise ConfigEntryNotReady from error
homeassistant.exceptions.ConfigEntryNotReady: 'TForbrugsLinje'
2023-01-17 19:35:53.804 DEBUG (MainThread) [custom_components.eforsyning.coordinator] Finished fetching eForsyning data in 2.534 seconds (success: False)
2023-01-17 19:36:44.682 DEBUG (MainThread) [custom_components.eforsyning] eForsyning ConfigData: {'username': 'USER', 'password': 'PASS', 'supplierid': 'ID', 'entityname': 'EForsyning', 'billing_period_skew': False, 'is_water_supply': False}
2023-01-17 19:36:44.695 DEBUG (SyncWorker_0) [custom_components.eforsyning.pyeforsyning.eforsyning] Getting api server at supplier ID

@mikaelmhansen
Copy link

Hi
Just wanted to report that II have the same experience. Geetting an error related to TForbrugLinje:

I installed the integration in Dec 2022 and it was working fine.

Now at some point i jan 2023 i stopped working.

When logging in to the eforsyning website (redirected to my local supplier), I see no data from 2023.
Perhaps that is the reason for the failure of the code to lookup the TForbrugslinje key.

@SirBj
Copy link
Author

SirBj commented Jan 22, 2023

Just looked at my data on the eforsyning website, and there is no data for jan 2023.
but also it look like i only have data on month basis, so maybe the data will come in the end of the data.

@mikaelmhansen
Copy link

After some dialog with my supplier. I was told that they currently only read twice a year. And that no registration is done until the first reading (june in my case).

So, i just manually uploade/entered a reading. That immediately caused the integration to work aggain. Albeit only with expected values (no real consumption values until the meter has been changed later this year). Perhaps you could try the same?

@SirBj
Copy link
Author

SirBj commented Jan 23, 2023

Hi mikaelmhansen

Mine have just started working, or at least it do not report the error.
But the ones that are not deactivated by the integration, are unavailable and show no data.

I think it might solve it selv, when data is pressent in Eforsynings webside, will wait and see.

How did you enter data manual?

@kpoppel
Copy link
Owner

kpoppel commented Feb 5, 2023

For me this solved itself. On the 23rd of January they decided to update the year to the correct value:
image

that said, the integration could be improved to handle this once-per-year thing and calculate the missing data. It is a bit of work and I think I need to put in some regression tests first before starting such a journey. So that may take a while because ... life and work and such.

@Symbiot78
Copy link

same issue here. Just downloaded the integration from scratch and tried to set it up. The integration fails to setup completely.

snip of data from supplier (so the integration does actually receive data:

2024-01-27 08:38:33.072 DEBUG (SyncWorker_1) [custom_components.eforsyning.pyeforsyning.eforsyning] Parsing results - IaltLinje for non-day data. 2024-01-27 08:38:33.072 DEBUG (SyncWorker_1) [custom_components.eforsyning.pyeforsyning.eforsyning] Getting time series 2024-01-27 08:38:33.072 DEBUG (SyncWorker_1) [custom_components.eforsyning.pyeforsyning.eforsyning] POST data to API. {'Ejendomnr': '4116', 'AktivNr': '1', 'I_Nr': '1', 'AarsMaerke': 2023, 'ForbrugsAfgraensning_FraDato': '0', 'ForbrugsAfgraensning_TilDato': '0', 'ForbrugsAfgraensning_FraAflaesning': '0', 'ForbrugsAfgraensning_TilAflaesning': '2', 'ForbrugsAfgraensning_MedtagMellemliggendeMellemaflas': 'false', 'Optioner': 'foBestemtBeboer, foSkabDetaljer, foMedtagWebAflaes', 'AHoejDetail': 'false', 'Aflaesningsfilter': 'afMaanedsvis', 'AflaesningsFilterDag': 'ULTIMO', 'AflaesningsUdjaevning': 'false', 'SletFiltreredeAflaesninger': 'true', 'MedForventetForbrug': 'true', 'OmregnForbrugTilAktuelleEnhed': 'true'} 2024-01-27 08:38:33.235 DEBUG (SyncWorker_1) [custom_components.eforsyning.pyeforsyning.eforsyning] Done getting time series 200, Body: { "ForbrugsLinjer": { "AktuelLinjeNr": "0", "AntLinjer": "1", "TForbrugsLinje": [ { "TempRetur": "34,7720591090785", "Afl_Nr": "254455", "AntTaellevaerker": "4", "TilDatoStr": "31-12-2023", "Art": "0", "STAflType": "60", "Lbnr_andet": "1", "Mell_AflNr": "11", "TForbrugsTaellevaerk": [ { "IndexNavn": "ENG1", "Enhed_Txt": "MWh", "Korrig": "0,000", "Beskrivelse": "Energi", "Enhed": "7", "Faktor": "1", "Slut": "34,119", "Start": "25,641", "Format": "##0.000", "Forbrug": "8,478" },{ "IndexNavn": "M3", "Enhed_Txt": "M3", "Korrig": "0,000", "Beskrivelse": "<beskrivelse>", "Enhed": "1", "Faktor": "1", "Slut": "1164,863", "Start": "1119,332", "Format": "###0.000", "Forbrug": "265,386"

error apparently causing the integration to fail setting up.

`
2024-01-27 08:38:33.522 DEBUG (SyncWorker_1) [custom_components.eforsyning.pyeforsyning.eforsyning] Parsing results - heating metering
2024-01-27 08:38:33.523 ERROR (MainThread) [custom_components.eforsyning.coordinator] Unexpected error fetching eForsyning data: 'TForbrugsLinje'
Traceback (most recent call last):
File "/config/custom_components/eforsyning/coordinator.py", line 53, in _async_update_data
data = await self.hass.async_add_executor_job(self.api.get_latest)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/eforsyning/pyeforsyning/eforsyning.py", line 469, in get_latest
result = self._parse_result_heating(day_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/eforsyning/pyeforsyning/eforsyning.py", line 602, in _parse_result_heating
for fl in result['ForbrugsLinjer']['TForbrugsLinje']:
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'TForbrugsLinje'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/eforsyning/coordinator.py", line 55, in _async_update_data
raise ConfigEntryNotReady from error
homeassistant.exceptions.ConfigEntryNotReady: 'TForbrugsLinje'
2024-01-27 08:38:33.524 DEBUG (MainThread) [custom_components.eforsyning.coordinator] Finished fetching eForsyning data in 1.710 seconds (success: False)
`

@kpoppel
Copy link
Owner

kpoppel commented Jan 27, 2024

This one is really difficult as it happens once per year (twice actually for the plugin January/July). I just changed jobs, but when the mental load of getting into that eases off, I want to take a closer look at this and the other bugs again.

@Symbiot78
Copy link

@kpoppel - no worries. real life trumps !
my old integration suddenly started behaving like this.. x time ago.
just tried to start over to see if I could get it working.

but as I wrote.. because of this error the integration will not initialize at all - so anyone wanting to start using it during this.. ..1-2 month period will not be able to set it up at all.

the integration - as shown in the log.. does connect and it does get data.. but it fails because of the missing 'new year' data.

maybe something could be done that would allow it to setup without crashing due to this missing data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants