robinostlund / homeassistant-volkswagencarnet

Volkswagen Carnet Component for home assistant
GNU General Public License v3.0
340 stars 63 forks source link

[BUG] CNG fuel status not displayed #626

Closed giovdi closed 6 months ago

giovdi commented 6 months ago

Before you post a new issue - you must first check the following (and check the boxes with an "X" below)

Environment

Describe the bug

My car is dual fuel CNG+gasoline, but only the second one is shown as sensors in Home Assistant. The range and the fuel level sensors refer to gasoline fuel.

Steps to Reproduce

You need a duel fuel CNG+gasoline car to reproduce the issue :) Just configure it and have a look at the available sensors.

Expected behavior

It's more important to have the CNG fuel status than the gasoline. If sensors for both primary and secondary fuels are impossible, please consider CNG as the main fuel. In my opinion, the totalRange_km value is useless.

Screenshots

5

Traceback/Error logs

No errors are shown or reported.

Debug information - all JSON responses from logfile

Link to Pastebin: https://pastebin.com/aVcwdRkk The paste will be deleted after the issue is closed. The VIN is masked.

Additional context

I don't know why the configuration you suggested in the Enabling Debug Logging in Home Assistant Wiki page and the Enable debug logging paragraph in the README.md file didn't work for me... but I figured out with this configuration:

6 4

logger:
  default: info
  logs:
    volkswagencarnet: debug
    dashboard: debug
    custom_components.volkswagencarnet: debug
    custom_components.volkswagencarnet.climate: debug
    custom_components.volkswagencarnet.lock: debug
    custom_components.volkswagencarnet.device_tracker: debug
    custom_components.volkswagencarnet.switch: debug
    custom_components.volkswagencarnet.binary_sensor: debug
    custom_components.volkswagencarnet.sensor: debug
    volkswagencarnet.vw_connection: debug

I hope this helps! :)

Note

Issues lacking sufficient details or context may be subject to closure without prior notice. Detailed bug reports are essential for effective issue resolution. Thank you for your cooperation.

Thank you for all your work!

stickpin commented 6 months ago

Hi @giovdi,

Thanks for reporting this issue! This is the first time I’ve encountered a vehicle with a CNG engine. I can proceed with the development without direct access, but it would be extremely helpful if you could share your credentials. This would allow me to thoroughly test all scenarios related to the CNG vehicle. If you’re okay with this, please also share your mobile number so I can contact you via Signal or WhatsApp before using the credentials. You can reach me at stickpins at gmail.com.

Best Regards! :)

giovdi commented 6 months ago

Hi @stickpin!

Thank you for your prompt reply :) It's not uncommon in Italy to find a car with a CNG engine, but it's uncommon to find a VW car with a CNG engine linked to Home Assistant 😁 .

Take your time to find the best solution for this development. I'll email you ASAP with everything you need.

Best!

stickpin commented 6 months ago

There are some funny scenarios because of this combination of engines. :)

The vehicles I've been working on up to now were either combustion, electric, or combustion + electric. But now, I have a scenario with two combustion engines, each with its own range and fuel/gas level. :)

I've already implemented a fix for the Combustion range sensor to consider the combined range of both combustion engines. I've added a new Gas level sensor in addition to the existing Fuel level sensor. Now, I'm working on adding two new sensors for vehicles with a CNG engine: Fuel range and Gas range. All this should cover your vehicle. :)

If everything goes well, and I am able to test the implementation this evening, I will release a new beta.

stickpin commented 6 months ago

Support for CNG vehicles is added in v5.0.0-beta2