wubbl0rz / FiatChamp

FIAT (uconnect) Home Assistant Addon 🚗
https://github.com/wubbl0rz/FiatChamp
MIT License
91 stars 17 forks source link

Units #40

Open bigstevehardy opened 1 year ago

bigstevehardy commented 1 year ago

So i cant seem to get miles for the range etc .... its stuck on km - have tried toggling the force km to miles but its still in km. Any ideas would be greatly appreciated as i love this integration !

bigstevehardy commented 1 year ago

[11:12:47 INF] Using unit system: { "Length": "km", "Mass": "g", "Pressure": "Pa", "Temperature": "°C", "Volume": "L", "wind_speed": "m/s", "accumulated_precipitation": "mm" } [11:12:47 INF] Convert km -> miles ? True [11:12:47 INF] Pushing new sensors and values to Home Assistant [11:12:58 INF] Fetching COMPLETED. Next update in 15 minutes. [11:14:40 INF] REFRESH SESSION [11:16:40 INF] REFRESH SESSION [11:18:40 INF] REFRESH SESSION

wubbl0rz commented 1 year ago

hi sorry for late response 🙈 "[11:12:47 INF] Using unit system" just means your home assistant configuration is set to this units. or is it not ? fiatchamp pulls this from the home assistant api. the addon config for km -> miles should convert the most values from the fiat api to miles if the fiat api delivers the values in km. is it really the wrong value or only the wrong unit ? can you post a screenshot from HA ?

if nothing works you could use a template sensor to convert values yourself but that sucks on larger scale for multiple sensors.

wubbl0rz commented 1 year ago

the automatic unit converting like km -> miles is a bit buggy i guess. i think the reason is that it only works where the fiat api explicitly returns a unit for the value. because otherwise its unknown in which unit the value is retrieved. could be that "totalRange" has no unit attached to it. some parts are a bit "hot glued" but idk how to improve this because the uconnect apis have no public documentation and i can only reverse engineer it from the fiat app and the way fiat does things is confusing sometimes 🥴 when i start to work again on fiatchamp i can add unit conversion for pressure and fix some buggy range units. until then i think its better to use a template sensor.