myTselection / Carbu_com

Actual fuel prices (super, diesel, lpg) per gasstation supported for Belgium, France, Luxembourg, Spain, Netherlands, Germany, Italy and US! Home Assistant custom component HACS integration for BE/FR/LU based on carbu.com and mazout.com site to compare and save on your actual fuel oil/heating oil (mazout) and fuel (diesel, super and lpg) purchases.
MIT License
20 stars 6 forks source link

BE-9052 location becomes 9050 sensor #45

Closed Moozzuzz closed 3 months ago

Moozzuzz commented 3 months ago

Configuring a 9052 BE postalcode for Carbu.com integration resulted in a sensor.carbu_comsuper959052_5km sensor in HA, however the name of the sensor became "Carbu.Com Super95 9050 5Km". So i'm wondering, is the bug in the naming (very small issue) or is the bug in the postalcode used in the algorithmes?

afbeelding

afbeelding

myTselection commented 3 months ago

Hi, the 5km and 10km sensors may change location, they point to the station with the lowest price in that neighborhood. The entity name (sensor name) will not change but the the friendly display name will change depending on the location where the cheapest station was found. So initially it will also show 9052, but when updated and a cheaper station is found with another postal code (within 5km or 10km limit) it will show the postal code of the location that was found. At every update of the price info, the name may change to reflect the postal code of the location with cheapest price. Btw, the friendly display name can be changed by yourself using the 'Configure' option once the sensor has been initiated.

See https://github.com/myTselection/Carbu_com?tab=readme-ov-file#installation:

After setting up the integration, the configuration can be updated using the 'Configure' button of the integration. The usage of a station filter can be enabled and set, the usage of a template to set the 'friendly name' of each sensor type can be enabled and set and the usage of icons with price indication can be enabled or disabled.

  • The checkboxes are required since else clearing the text of the configuration was not recorded (HA bug?) and filter or templates could no longer be removed once set.
  • When setting a sensor 'friendly name' template, any sensor attribute can be used as a placeholder which will be replaced with the actual value. Eg: Price {fueltype} {fuelname} {supplier} could be used as a template for te Price sensor. All available attributes can be fetched using the 'Developer Tools' > 'States' > 'Attributes' view in HA or using the tables listed below.

So this is a feature, not a bug ;)