-
Notifications
You must be signed in to change notification settings - Fork 3
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
problems with summary.py #51
Comments
You should regularly run monitor.py which will write to monitor.csv. |
Monitor.csv has the correct data. (Compared to the data sent by dailystats.py.)
I think the problem is in summary.py somewhere.
In summary.csv I only get the headlines. Have tried to change language from “da” to “en” and back
And thanks for a fine program. I love to go deep in data to become wiser
Lars Bluhme
…________________________________
Fra: Zuinige Rijder ***@***.***>
Sendt: Tuesday, April 11, 2023 1:36:36 PM
Til: ZuinigeRijder/hyundai_kia_connect_monitor ***@***.***>
Cc: Lars Bluhme ***@***.***>; Author ***@***.***>
Emne: Re: [ZuinigeRijder/hyundai_kia_connect_monitor] problems with summary.py (Issue #51)
You should regularly run monitor.py which will write to monitor.csv.
summary.py will use the data of monitor.csv.
What is inside monitor.csv?
—
Reply to this email directly, view it on GitHub<#51 (comment)>, or unsubscribe</~https://github.com/notifications/unsubscribe-auth/AMACE6QAONG7IFSD63KJ5ILXAU64JANCNFSM6AAAAAAW2ESXOQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Did you give parameters to summary.py? summary.charge.csv Can you post the (anonymized) contents of monitor.csv? I assume you are in the same directory as were monitor.csv is stored? You may also send this by email, I use a gmail account, zuinige.rijder And what is the output when you run: |
Hello again Found out. In my data the odometer value is 0.0. I think it is a bug in the newest upgrade to hyundai software. When the car stops the value of odometer in the app shows 0.0. If you get a reading while the car runs, I think you get a true value Anyway, apparently the code in summary.py will not accept 0.0 as value in odometer and stops running. So either you can only get updates from the car with the engine running or you can accept in the code of summary.py that the value of odometer is 0.0 Hope that makes sense Yours Lars |
Hi Lars, Indeed is that the problem. I had this problem too on the IONIQ 5. See this issue: Hyundai-Kia-Connect/hyundai_kia_connect_api#196 (comment) NE_E.EUR.S5W_L.001.001.221129 on December 6th for IONIQ5: and it was solved with version 221223: Which car do you have? Probably this is also fixed when updating the infotainment version to the latest version. |
I have a Kona Electric with sw: OS_E_PE.EUR.S5W_L.001.001.221129. Looks like it is a bit older than yours. But the installer (Navigation Updater) finds this one. I will be looking for a new update. |
By the way. Do you know where I can find the newest firmware for my Kona. When I follow the “official” way I get the version from November 2022 |
There is also for the Kona a version 221223, see this link: Just download the latest version, you will see inside the Kona_EU.ver the version 221223. |
You are right. Performed an update and installed 122322. Now everything works. |
Hi @ZuinigeRijder |
@Bluhme1 Just move at 1 january 2024 all the csv files (*.csv) to a backup folder (e.g. 2023) , maybe you want to look back to those results in the future. But do NOT move monitor.translations.csv. Possibly older data of 3 months old is recreated for monitor.tripinfo.csv and monitor.dailystats.csv. You can also just remove manually all the entries with 2023 in all the csv files, when 2024 data is added or when you moved the *.csv files too late to another location (and you would miss some days from 2024). |
Thanks a lot. Will do that tomorrow. |
@ZuinigeRijder [MQTT] /Lars |
@Bluhme1 It looks ok. Note that only when there is something added in monitor.csv, monitor.tripinfo.csv and/or monitor.dailystats.csv the corresponding line is splitted and send to MQTT. You can trigger this testing by e.g. removing the last line of monitor.csv , monitor.tripinfo.csv and/or monitor.dailystats.csv. I did only test with a test server, because I do not have HA. Let me know if this was the problem, otherwise we have to dig deeper. Does it work with test.mosquitto.org? |
@ZuinigeRijder Everything works now. Great and thank you. I have succeeded in getting data into my MQTT broker (which is an add-on in HomeAssistant). From there I have made MQTT sensors the manual way. I enclose af few screenshots to show my results I have made a few changes in the yaml code of the manual sensors to streamline the data a bit. (Using kwh as measure unit and showing dates and times in the way we do in Denmark) If you plan to make the Homeassistant experience even better you can perhaps make the sensors "discoverable" so that Homeassistant picks them up automatically when they appear in the MQTT broker. But again thank you for your great work /Lars |
@Bluhme1 Thanks for the screenshots. Good to hear it worked. I will have a look into the MQTT discovery. I am also thinking about sending computed information from summary.py and/or dailystats.py to MQTT. E.g. the few last lines of summary.py:
And the totals of dailystats:
However, I do not know if I should return the information unsplitted (comma seperated) or splitted per item. Do you have ideas? Which information is interesting? |
That would be great and very useful. I would clearly recommend to sent the data splittet pr. item. Just my quick response. Hope you can use it Yours Lars |
@Bluhme1 I have added sensors for summary.py and dailystats.py. See this release. |
Great. I have installed the new version and everything works fine. It is an abundance of data. Now I am starting the project of making manual MQTT entities in Homeassistant to show the data in HA. We are talking about a great number of entities, so it will take some time. Thank you , again for your great work |
@Bluhme1 Strange that it is not working for you. Note that monitor.py entries directly below your VIN number are no longer updated, I moved this information to the subtopic hyundai_kia_connect_monitor/VIN/monitor. Probably it is better to remove the top level entries manually from MQTT Explorer. Can you run the command:
This will give a lot of output, but at the end it should show the information which is send to MQTT Broker. Part of my last output with test data:
|
Hi Deleted the stale entries and ran the debug command. No mention of MQTT anywhere |
Maybe some help in debugging. After I deleted the posts directly below the VIN number they have returned with values today. Am I running a wrong version. The date of my summary.py is 20/11,2024 |
That is the same timestamp as in the latest Release R4.2.0. So the versions seems right. What is the output of the last lines with the following command:
For me with the testdata, the last 11 lines of output is:
You can mail me the output, because it can contain sensitive data, like Address. |
I found the problem, in my test I used language is "en". But when set to "nl" the output is different. I filtered on the non-translated headers!
I will make a fix soon. |
Changed the language to English and now everything works fine. Has the issue something to do with the posts returning from the previous build? |
No, in your screenshot the top-level values immediately below topic hyundai_kia_connect_monitor/VIN did not longer appear. The appear one level lower: hyundai_kia_connect_monitor/VIN/monitor. I made a fix, so summary.py should also work in Danish (I hope). See fix in attachment (just rename mqtt_utils.py.txt into mqtt_utils.py). Note that you will get the translated headers as subtopic below summary. |
The same problem is in Domoticz. I will have another solution, where I want to keep the original English headlines..... |
The fix works for me. Thank you |
You can indeed delete the last line in monitor.csv. But you can also put the car in Drive and thereafter just fully off again ;-) |
I made a new release which should fix all the problems with respect to MQTT/Domoticz: R4.2.1. Note that the MQTT subtopics have now the original header name, so not the translated ones. |
Great. Nice to see that it is working and useful. Still a lot of effort to map the MQTT to HA, I assume. |
I had som help from ChatGPT that could create sensors automatically from the state_topic lines imported from MQTT.Helped a lot and saved a lot of time. You need to know the YAML syntax, however, to put the right prompts |
Ah, ChatGPT to the rescue. Can you post the configuration.yaml here? So I can put this as example in the README? |
Hi, Here you go There are many entries. They should be included in configuration.yaml or put into a file called mqtt.yaml and "mqtt: !include mqtt.yaml" (without quotes)should be added to configuration.yaml. If put in configuration.yaml the lines should be preceded by
If put in a separate file called mqtt.yaml the lines should be preceded by Remember right intention (Homeassistant users would know) |
Hi Bluhme1, thanks for sharing this. In my case it showed there were errors in MQTT.txt. What I did (as you described):
One thing I forgot was changing the VIN number in there. Once I fixed that my sensors where showing data. I'm really happy you shared this with us and I didn't have to figure this out myself. And I don't know if this escape char issue is only with my configuration. This might help someone else. |
@rpositive Probably my examples/configuration.yaml has to be updated too then. Can you check if below is correct? Then I can update the yaml example. |
@rpositive You are right. The MQTT.txt was created in Textedit and it looks like the program has added the \ after each line. Perhaps as a line break. I don't have that character in my MQTT settings and consequently everything works fine at my end and I didn't find the problem. Sorry. And a Merry Christmas to both of you |
This file doesn't have the escape char. Thanks |
In running summary.py I get only headlines. No data. But when I run dailystats.py I get all data. Tried to run debug.py and got python debug.py
}
targetSOClist:
[
]
Summary:
Target SOC level : 100
Target SOC range : 437
Target SOC level : 100
Target SOC range : 437
Last updated at : 2023-04-11 13:13:35+02:00
Location Last updated at: 2023-04-11 13:13:33+02:00
Location : (10.169544, 55.977997)
Air temperature : 15.0
Driving range : 431.0
Charge limits AC : 100
Charge limits DC : 100
Odometer : 0
Total driving range : 431.0
Battery SOC : 98
12V percentage : 84
Locked : False
The text was updated successfully, but these errors were encountered: