Releases: ZuinigeRijder/hyundai_kia_connect_monitor
Various bug fixes
- Fixed problems when the password in monitor.cfg contains special characters (e.g. % is used for interpolation of ConfigParser). See this issue
- Support Kia Sportage HEV by having default values in monitor.py for ev_battery_percentage, ev_battery_is_charging, ev_battery_is_plugged_in. See this post in Dutch language.
- Added example configuration.yaml, thanks to @Bluhme1 See screenshots here and some Home Assistant instructions.
fix: MQTT/Domoticz summary.py items were not send when language was NOT English
When language was NOT English the MQTT/Domoticz items were not send. This was only the case for summary.py.
Also added tests to cover this use-case.
summary.py and dailystats.py now also sends data to Domoticz and/or MQTT Broker
Added support for Domoticz and/or MQTT Broker (e.g. HomeAssistant, ioBroker)
Important note: there is a dependency on the following package added: paho_mqtt>=1.6.1
Changes to the output csv files are also send to Domoticz and/or MQTT Broker (e.g. HomeAssistant, ioBroker) when configured. When configured, the data is send to mqtt_main_topic/VIN/subtopic.
Example screenshot using MQTT Explorer:
Fix to run commands at least once a day
Small fix that after login always the commands are run when configured.
fix: monitor.py would not run once anymore
fix: monitor_execute_commands_when_something_written_or_error not executed
Small fix to previous release, monitor_execute_commands_when_something_written_or_error not executed.
Major update: introduction of running monitor.py infinitely
Made regularly collecting the cached server data by monitor.py easier, for example by running the "python monitor.py" command once an hour and/ or infinite. A server is of course best. I use a Raspberry Pi, but it can also done regularly or infinite on a Windows 10 or Mac computer, provided the computer is on.
Note: each time monitor.py asks for cache server values, it makes a snapshot of the latest server cache values when different. How more often you run it, the better charges and trips can be detected by summary.py. The easiest way is to run monitor.py infinite.
Added configuration items to monitor.cfg:
- monitor_infinite, if set to True monitor.py keeps running using monitor_infinite_interval_minutes between getting cached server values
- monitor_infinite_interval_minutes, interval in minutes between getting cached server values
- monitor_execute_commands_when_something_written_or_error, when new cached server values are retrieved, the specified commands (separated by semicolon ;) are executed. See Note 1.
- example: monitor_execute_commands_when_something_written_or_error = python -u summary.py sheetupdate > summary.log;python -u dailystats.py sheetupdate > dailystats.log
Note 1: in combination with infinite (monitor_infinite = True) summary.py and dailystats.py are only run when something is changed or error occurred (or once a day). You do not need to run summary.py and dailystats.py separately and it is only run when it is needed.
Note 2: an Bluelink USA user has detected that there is a limit in the number of logins, not for the subsequent calls, therefore the option to run monitor.py infinite is a good choice. The monitor.py infinite does only login once per day and then the subsequent calls are done with the retrieved information. Unfortunately for Europe the total is restricted to about 200, so the number of logins does not matter. For the other regions I do not know the limit and behavior.
Dependent on your regular driving habit, choose the best option for you. Example:
- run monitor.py infinite (monitor_infinite = True) with monitor_infinite_interval_minutes = 15 (means 96 requests per day and 1 login per day)
Added example scripts for running monitor.py infinite for Raspberry Pi and other Linux based systems.
Added a separate python tool, tail2GoogleSheet to follow the content of a file on a server and send it to a Google Sheet with the same filename. Examples: follow monitor.csv or the output log file of monitor.py. Great to be able to look at the last -n lines of a log-file or any other file on your smartphone, tablet or computer without logging in to the server.
Added Configuration of default logging and formatting of logging.
Note 3: Please do not forget to copy logging_config.ini to your hyundai_kia_connect_monitor.
Note 4: The possibility to run monitor.py once is still the default, although monitor_infinite = True has advantages. So invest some time to switch to the new way of running monitor.py infinite.
Added consumption efficiency factor configuration
I think that the consumption values of the on-board computer are corrected with an efficiency number, e.g. 1 kWh of energy results in 0.9 kWh of real energy (losses when converting battery kWh by the car). So therefor I introduced an efficiency configuration factor in monitor.cfg, consumption_efficiency_factor_dailystats and consumption_efficiency_factor_summary. For example, when setting this to 0.9, 10% of the energy is lost during the conversion and is used in the consumption calculation. Default the values are 1.0, so no correction.
The following entries are added to monitor.cfg:
- consumption_efficiency_factor_dailystats = 1.0
- consumption_efficiency_factor_summary = 1.0
I include_regenerate_in_consumption a while ago, for the consumption calculation in daily stats. However, I think that the above 2 configuration items will better match the board computer values.
Small improvement for previous workaround
Small improvement for Workaround for server often returns last_updated_at 2 hours earlier.
Make sure that the new latest_updated_at is newer than the previous latest_updated_at.