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

day : Missing total value in values: #17

Closed
forzewin opened this issue Sep 15, 2022 · 27 comments
Closed

day : Missing total value in values: #17

forzewin opened this issue Sep 15, 2022 · 27 comments
Labels
bug Something isn't working enhancement New feature or request server issue

Comments

@forzewin
Copy link

Hello,

since few days i have no data in the energy section. live info is working but no historical.

i have thoses errors in logs :

#Cette erreur provient d'une intégration personnalisée

Logger: custom_components.keyatome.sensor
Source: custom_components/keyatome/sensor.py:588
Integration: KeyAtome Linky (documentation, issues)
First occurred: 09:52:48 (186 occurrences)
Last logged: 22:55:16

day : Missing total value in values: {'isConnected': True, 'time': '2022-09-15T22:39:31+02:00', 'total': 0, 'logTargetStd': 0.0, 'goal': 100, 'startPeriod': '2022-09-15T00:00:00+02:00', 'endPeriod': '2022-09-15T22:39:31+02:00', 'pricingChange': 0, 'filteredPower': 0.0, 'impactCo2': 11767, 'impactVehicleType': 'CAR', 'impactVehicleKm': 107}
day : Missing total value in values: {'isConnected': True, 'time': '2022-09-15T22:44:38+02:00', 'total': 0, 'logTargetStd': 0.0, 'goal': 100, 'startPeriod': '2022-09-15T00:00:00+02:00', 'endPeriod': '2022-09-15T22:44:38+02:00', 'pricingChange': 0, 'filteredPower': 0.0, 'impactCo2': 11767, 'impactVehicleType': 'CAR', 'impactVehicleKm': 107}
day : Missing total value in values: {'isConnected': True, 'time': '2022-09-15T22:49:43+02:00', 'total': 0, 'logTargetStd': 0.0, 'goal': 100, 'startPeriod': '2022-09-15T00:00:00+02:00', 'endPeriod': '2022-09-15T22:49:43+02:00', 'pricingChange': 0, 'filteredPower': 0.0, 'impactCo2': 11767, 'impactVehicleType': 'CAR', 'impactVehicleKm': 107}
day : Missing total value in values: {'isConnected': True, 'time': '2022-09-15T22:54:48+02:00', 'total': 0, 'logTargetStd': 0.0, 'goal': 100, 'startPeriod': '2022-09-15T00:00:00+02:00', 'endPeriod': '2022-09-15T22:54:48+02:00', 'pricingChange': 0, 'filteredPower': 0.0, 'impactCo2': 11767, 'impactVehicleType': 'CAR', 'impactVehicleKm': 107}
week : Missing total value in values: {'isConnected': True, 'time': '2022-09-15T22:55:16+02:00', 'total': 0, 'logTargetStd': 0.0, 'goal': 100, 'startPeriod': '2022-09-12T00:00:00+02:00', 'endPeriod': '2022-09-15T22:55:16+02:00', 'pricingChange': 0, 'filteredPower': 0.0, 'impactCo2': 44913, 'impactVehicleType': 'CAR', 'impactVehicleKm': 408}

what should i do ?

thanks !

@jugla
Copy link
Owner

jugla commented Sep 15, 2022

I don't why Total Energy don't give the info.
The error messages tell that the field is missing...
Can you restart HA (in order to force a complete new login) to see if error persists ?

@beromont
Copy link

Hi, I have the same problem, only live power is working :
image
did total energy change their api ?

@forzewin
Copy link
Author

Complete restart does not restore missing values

@jugla
Copy link
Owner

jugla commented Sep 16, 2022

Agree with both of you @forzewin @beromont .
In API , there is no more the value of day/month/week/yearly consumption.
The request works but the reply has no more the data field :-(

@jugla
Copy link
Owner

jugla commented Sep 16, 2022

I publish 6.3.1 to avoid stucking LiveRequest. Period Consumption will depend on TotalEnergies server ...

@jugla jugla added bug Something isn't working server issue labels Sep 16, 2022
@forzewin
Copy link
Author

thanks @jugla

that's a bummer...

@BenoitAnastay
Copy link
Contributor

Even the Elec & Gaz official app struggle to grab the consumption data we must go on the main page then wait after the live power to be displayed then the history is updated.

Thus I guess the API had some changes.

I'll give a look at that issue

@BenoitAnastay
Copy link
Contributor

So the endpoint consumption.json do not seem to be used anymore by the app, the new endpoint seems to be API_BASE_URI + "/apiV2/dataJSON/" + self._user_id + "/" + self._user_reference + "/3months" which report daily total

To grab the current day cosumption we can use values["data"][-1]["totalConsumption"] unfortunatly for others sensors we must do the maths localy

I don't know much abou long term statistics but maybe we can update past values we the array reported by the v2 api 🤷

@jugla
Copy link
Owner

jugla commented Sep 18, 2022

Thanks a lot @BenoitAnastay !!
I have modified pykeyatome. I'm building keyatome

@jugla
Copy link
Owner

jugla commented Sep 18, 2022

ok the patch works locally (for day).
I let HA run 1 / 2 hours , then I push pykeyatome and keyatome.

NB : I will let week/month/year for time being

@jugla
Copy link
Owner

jugla commented Sep 18, 2022

@BenoitAnastay , the release V7.0.0 is dedicated to you

@BenoitAnastay
Copy link
Contributor

@BenoitAnastay , the release V7.0.0 is dedicated to you

Ok thanks, for that specific case you can set a co-author on a commit

https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors

For me on the commit comment you can put this line in the commit message

Co-authored-by: Benoit Anastay <45088785+BenoitAnastay@users.noreply.github.com>

The documentation to amend commit is here https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message

@BenoitAnastay
Copy link
Contributor

On this line you use bill2, you assume that you have day/night option, for ppl with BASE option it wil throw a key error (only bill1 is present)

+ values["data"][-1]["consumption"]["bill2"]

for the total you can also multiply the priceindex by index divided per 1000 (if the sum of bill1+bill2 is an issue)

@jugla
Copy link
Owner

jugla commented Sep 18, 2022

Thank you very much
I've taken the pull request for bill2

@jugla jugla added the enhancement New feature or request label Sep 18, 2022
@forzewin
Copy link
Author

thanks both of you, i can confirm it works for me aswell, i use it on a daily basis, im glad you guys found a solution

@jedifr
Copy link

jedifr commented Sep 19, 2022

Bonjour,

Depuis le souci de mise à jour, j'ai désinstallé puis réinstallé le module.
Depuis, les capteurs ne s'affichent plus sauf l'entité "[update.keyatome_update]"
A la réinstallation, je n'ai pas eu non plus à renseigner mes identifiants.

Est-ce Normal ?
Merci

@BenoitAnastay
Copy link
Contributor

BenoitAnastay commented Sep 19, 2022 via email

@jedifr
Copy link

jedifr commented Sep 19, 2022

Bonjour,

J'espère que c'est le bon document...
Je débute avec HA

2022-09-19 16:28:54.137 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration eufy_security which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-19 16:28:54.140 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sonoff which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-19 16:28:54.142 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration keyatome which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-19 16:28:54.145 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration myEnedis which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-19 16:28:54.147 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-19 16:28:54.149 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration meross_cloud which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-19 16:29:13.769 WARNING (MainThread) [custom_components.meross_cloud] Skip MQTT cert validation option set to: False
2022-09-19 16:29:14.048 WARNING (MainThread) [homeassistant.util.async_] Detected blocking call to putrequest inside the event loop. This is causing stability issues. Please report issue to the custom integration author for myEnedis doing blocking calls at custom_components/myEnedis/gitinformation.py, line 37: myURL = urlopen(self._serverName)
2022-09-19 16:29:15.137 WARNING (MainThread) [custom_components.meross_cloud]
===============================
Meross Cloud Custom component
Developed by Alberto Geniola
Low level library version: 0.4.5.0
-------------------------------
This custom component is under development and not yet ready for production use.
In case of errors/misbehave, please report it here:
https://github.com/albertogeniola/meross-homeassistant/issues
If you like this extension and you want to support it, please consider donating.
-------------------------------
List of devices reported by HTTP API:
- Lampe du salon (mss110rtl) - OnlineStatus.ONLINE
===============================
2022-09-19 16:29:17.464 WARNING (MainThread) [meross_iot.manager] Found a new device Lampe du salon (mss110rtl, HW 4.0.0, FW 4.2.3, class: mss110rtl:4.0.0:4.2.3) that has become online while we were offline.
2022-09-19 16:29:22.878 ERROR (SyncWorker_7) [myEnedis] 06426628052339 - last call : updateYesterdayProduction
2022-09-19 16:29:22.954 ERROR (SyncWorker_7) [myEnedis] myEnedis ...06426628052339 update termine, on retentera plus tard(B)
2022-09-19 16:29:22.977 ERROR (SyncWorker_7) [myEnedis] ------------------------------------------------------------
2022-09-19 16:29:22.987 ERROR (SyncWorker_7) [myEnedis] Erreur inconnue call ERROR 'str' object has no attribute 'get'
2022-09-19 16:29:23.013 ERROR (SyncWorker_7) [myEnedis] Erreur last answer 'str' object has no attribute 'get'
2022-09-19 16:29:23.038 ERROR (SyncWorker_7) [myEnedis] Erreur last call updateYesterdayProduction
2022-09-19 16:29:23.042 ERROR (SyncWorker_7) [myEnedis] Erreur last answer None
2022-09-19 16:29:23.046 ERROR (SyncWorker_7) [myEnedis] Traceback (most recent call last):
File "/config/custom_components/myEnedis/myClientEnedis.py", line 1142, in update
self.callProduction()
File "/config/custom_components/myEnedis/myClientEnedis.py", line 1110, in callProduction
self.updateYesterdayProduction()
File "/config/custom_components/myEnedis/myClientEnedis.py", line 733, in updateYesterdayProduction
data = self._productionYesterday.updateData(
File "/config/custom_components/myEnedis/myDataEnedisProduction.py", line 91, in updateData
if (callDone) and (myCheckData().checkData(self._data)):
File "/config/custom_components/myEnedis/myCheckData.py", line 45, in checkData
if dataAnswer.get("error_code", 200) == 500:
AttributeError: 'str' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/myEnedis/myClientEnedis.py", line 1233, in update
raise Exception(inst)
Exception: 'str' object has no attribute 'get'
2022-09-19 16:29:23.074 ERROR (SyncWorker_7) [myEnedis] ------------------------------------------------------------
2022-09-19 16:29:23.098 WARNING (SyncWorker_7) [myEnedis] (<class 'Exception'>, Exception(AttributeError("'str' object has no attribute 'get'")), <traceback object at 0x7f3b167964c0>)
2022-09-19 16:29:23.100 ERROR (SyncWorker_7) [myEnedis] LastMethodCall : updateYesterdayProduction

@jugla
Copy link
Owner

jugla commented Sep 19, 2022

Strange.
Your logs don't show anything on keyatome.
The logs are in ~/.homeassistant/home-assistant.log .
Please can you fetch for an "ERROR" with keyatome and sends this part.
Or something with unexpected.

>>> French<<<<
Bizarre,
Tes logs ne montrent rien sur keyatome
Les logs sont dans ~/.homeassistant/home-assistant.log .
Stp, peux-tu cherher le mot "ERROR" avec keyatome et envoyé cette partie.
Ou qqch avec "unexpected"

@BenoitAnastay
Copy link
Contributor

BenoitAnastay commented Sep 19, 2022

Your logs don't show anything on keyatome.

Actually it does just tell that

2022-09-19 16:28:54.142 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration keyatome which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

@jedifr Can you remove the integration from the config pannel or yalm file, then add it again from the UI ?

https://my.home-assistant.io/redirect/config_flow_start/?domain=keyatome

@jedifr
Copy link

jedifr commented Sep 20, 2022

Hello,

You can find the log below :

===============================
2022-09-20 07:49:38.453 WARNING (MainThread) [meross_iot.manager] Device Lampe du salon (#BASE:2103290655416351855348e1e967d3e9) has been already added to the registry.
2022-09-20 07:49:38.523 WARNING (MainThread) [meross_iot.manager] Found a new device Lampe du salon (mss110rtl, HW 4.0.0, FW 4.2.3, class: mss110rtl:4.0.0:4.2.3) that has become online while we were offline.
2022-09-20 07:49:39.845 ERROR (SyncWorker_10) [myEnedis] 06426628052339 - last call : updateYesterdayProduction
2022-09-20 07:49:39.918 ERROR (SyncWorker_10) [myEnedis] myEnedis ...06426628052339 update termine, on retentera plus tard(B)
2022-09-20 07:49:39.919 ERROR (SyncWorker_10) [myEnedis] ------------------------------------------------------------
2022-09-20 07:49:39.920 ERROR (SyncWorker_10) [myEnedis] Erreur inconnue call ERROR 'str' object has no attribute 'get'
2022-09-20 07:49:39.942 ERROR (SyncWorker_10) [myEnedis] Erreur last answer 'str' object has no attribute 'get'
2022-09-20 07:49:39.944 ERROR (SyncWorker_10) [myEnedis] Erreur last call updateYesterdayProduction
2022-09-20 07:49:39.951 ERROR (SyncWorker_10) [myEnedis] Erreur last answer None
2022-09-20 07:49:40.009 ERROR (SyncWorker_10) [myEnedis] Traceback (most recent call last):
File "/config/custom_components/myEnedis/myClientEnedis.py", line 1142, in update
self.callProduction()
File "/config/custom_components/myEnedis/myClientEnedis.py", line 1110, in callProduction
self.updateYesterdayProduction()
File "/config/custom_components/myEnedis/myClientEnedis.py", line 733, in updateYesterdayProduction
data = self._productionYesterday.updateData(
File "/config/custom_components/myEnedis/myDataEnedisProduction.py", line 91, in updateData
if (callDone) and (myCheckData().checkData(self._data)):
File "/config/custom_components/myEnedis/myCheckData.py", line 45, in checkData
if dataAnswer.get("error_code", 200) == 500:
AttributeError: 'str' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/myEnedis/myClientEnedis.py", line 1233, in update
raise Exception(inst)
Exception: 'str' object has no attribute 'get'

2022-09-20 07:49:40.031 ERROR (SyncWorker_10) [myEnedis] ------------------------------------------------------------
2022-09-20 07:49:40.062 WARNING (SyncWorker_10) [myEnedis] (<class 'Exception'>, Exception(AttributeError("'str' object has no attribute 'get'")), <traceback object at 0x7f5cdd2896c0>)
2022-09-20 07:49:40.070 ERROR (SyncWorker_10) [myEnedis] LastMethodCall : updateYesterdayProduction

@BenoitAnastay
Copy link
Contributor

@jedifr there is definitely no reference to keyatome, did you try to remove and set up the integration again from the UI?

@jedifr
Copy link

jedifr commented Sep 20, 2022

Hello,

I tried this more than 4 times with reboot before new installation.
It' strange...

@BenoitAnastay
Copy link
Contributor

BenoitAnastay commented Sep 20, 2022

@jedifr I guess that your issue isn't related to this one, we can maybe close this one and you open a new one for your issue

You can still check if the entities aren't in the hidden or disabled list

@jugla
Copy link
Owner

jugla commented Sep 20, 2022

Agree with @BenoitAnastay , @jedifr , I will open a new ticket for your issue.
Meanwhile can you remove myEnedis integration , you got a lot of issue. Just to clean.
Please, in the log can you look exception keyword or unexpected (if any) related to kyatome.

@jugla
Copy link
Owner

jugla commented Sep 20, 2022

Please @jedifr can you write detail in #19 so that I can close this ticket.

@jugla
Copy link
Owner

jugla commented Sep 21, 2022

With @forzewin comments (it works!), I close the ticket.

@jugla jugla closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request server issue
Projects
None yet
Development

No branches or pull requests

5 participants