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
23 stars 6 forks source link

one fuel station is missing & markdown card question #31

Closed 1mfaasj closed 1 year ago

1mfaasj commented 1 year ago

Hi again! I've got 2 things to mention:

Looks like this fuel station is missing / not listed anymore when I search for it in the dropdown (zip code 3630):

I also try to use the markdown card but I can't get this part to work: image The result stays on "none" but the prices differs between the two fuelstations, so I expect to see a result. any ideas to get this fixed? is your example code still valid?

thanks!

myTselection commented 1 year ago

Indeed some station are now no longer listed in the drop-down. Because I was testing for the exact same station I noticed the price didn't load. Only after a lot of debugging I realised the price for this station is not available on the Carbu.com website. So no bug but confusing. So to make sure other users won't get confused, I filtered the drop-down and only show stations with a price.

Can you show your markdown?

1mfaasj commented 1 year ago

the markdown code:

type: vertical-stack
cards:
  - type: markdown
    content: >
      ## Super95 benzine

      #### Komende dagen: {% if
      states('sensor.carbu_com_super95_prediction')|float < 0 %}<font
      color=green>{{states('sensor.carbu_com_super95_prediction')}}%</font>{%
      else %}<font
      color=red>{{states('sensor.carbu_com_super95_prediction')}}%</font>{%
      endif %}
  - type: horizontal-stack
    cards:
      - type: markdown
        content: >
          #### <center>Belgie </center>

          <center><img
          src="{{state_attr('sensor.carbu_com_super95_3630_gabriels_maasmechelen_price','entity_picture')}}"
          width="45"/> </center>

          <center>

          [{{state_attr('sensor.carbu_com_super95_3630_gabriels_maasmechelen_price','supplier')}}]({{state_attr('sensor.carbu_com_diesel_5611_gh_5km','url')}})

          ###
          <center>{{states('sensor.carbu_com_super95_3630_gabriels_maasmechelen_price')}}
          €/l
      - type: markdown
        content: >
          #### <center>NL</center>

          <center><img
          src="{{state_attr('sensor.carbu_com_diesel_5611_gh_5km','entity_picture')}}"
          width="45"/></center>

          <center>

          [{{state_attr('sensor.carbu_com_diesel_5611_gh_5km','supplier')}}]({{state_attr('sensor.carbu_com_diesel_5611_gh_5km','url')}})

          ###
          <center>{{states('sensor.carbu_com_diesel_5611_gh_5km')}}
          €/l

          Besparing tov Belgie =
          {{state_attr('sensor.carbu_com_diesel_5611_gh_5km','price
          diff %')}} of
          **{{state_attr('sensor.carbu_com_diesel_5611_gh_5km','price
          diff 30l')}}** op 30l

looks correct right?

myTselection commented 1 year ago

yes looks correct to me. best to copy some parts of it into the 'Developer' > 'Template' section. This way you may get a better error description or try to find the part which causes issues. Also good to validate the sensor attributes to via 'Developer' > 'States'

myTselection commented 1 year ago

I believe the error is related to the name of the sensors you use: sensor.carbu_com_diesel_5611_gh_5km should probably be written witout the gh: sensor.carbu_com_diesel_5611_5km