Parking lots (garages) in Ghent. Can someone help to develop?

travelling, copy it into the code section of the card

or use a manual card to add and copy it there.
EDIT: note that the state_attr is case sensitive, so if your first attr is garages in stead of Garages then do change that

Thanks a lot for your help! It was indeed case sensitive; :slight_smile:
And I was missing the module card-mod so I installed it via HACS.

2 final questions:

  1. The list shows 10 results while the datafeed has 12. I didn’t notice anything in the code that would limit this.
  2. If you look at the 4th column ‘Bezetting’ then this doesn’t always seem to be the difference between amount of parking spaces and free spaces.

I can see only 10 (0 to 9)
image

You are hopefully not asking me why Ghent garages cannot calculate the diff between two figures :crazy_face:

But on 2 seriously, and where i live this is more than common…people take up more space quite a few times or the system is broken or calc is wrong indeed (doubt it)

Hi,

Ok. So only 10 are send by the API then?
On this URL I saw 12 garages but this isn’t in the API then.

Thanks for all the help!

Have a nice day!

I just copied your api/link and noticed the output. I have no clue about non-API data
Where do you see 12 garages?
EDIT, and if you want me to start a rant on discrepancies (as a Dutch guy living in France)…be really sure … :face_with_symbols_over_mouth:

I forgot to paste the link. :slight_smile:

I know that you can only provide the information that is available. Stad Gent probably needs to check the data.

If you look at the API tab, the default setting is 10 rows so that explained the initial link being limited
In the sensor you can change the https to this which has rows=15 in it, it will still show only 12 but then you are prepared if/when Ghent decides to add garages.

https://data.stad.gent/api/records/1.0/search/?dataset=bezetting-parkeergarages-real-time&q=&rows=15&sort=-occupation&facet=name&facet=lastupdate&facet=description&facet=categorie

Thank you so much for all the help!!! Everything is working now! :slight_smile:

besides the actual content, this is an amazingly nice card_mod for the markdown card :wink:

Id strongly suggest you post this in the card_mod thread, so all can learn how to nicely display a Markdown listing.

This warrants its own section in the example listing at the top imho.

Id probably want to add some scrolling there to keep the header visible at al times, but we have tools for that using the <p> </p> , just have to find the correct spot for adding that :wink:

very nice! thanks

Great, could you please mark (tickbox) one of my posts for ‘solution’ as this may help others too

I am not very advanced in the CSS area so what do you mean with scrolling? If I put such a list on my dashboard (I have other much larger lists too), it is the dashboard that scrolls, not the list. Do I read it correctly that within a markdown card one can scroll too? Do you have an example on how to accomplish this?

sure. In its simplest form you can scroll the contents like:

type: custom:hui-element
card_type: markdown
card_mod:
  style: |
    ha-card.type-markdown {
      box-shadow: none;
      border-top: 1px groove var(--divider-color);
      overflow-y: scroll;
      height: 300px;
    }
content: >


note this is using some custom elements. in a single markdown card you can use it directly, but I have these inside entities cards, so have set these extra mods to secure it only applies to that single card.

a bit more complex, and that is what I was referring to, would be to use paragraphs <p>text</p>, and scroll inside the contents:
see the post by Ildar and some issues with that because of templating: 🔹 Card-mod - Add css styles to any lovelace card - #4376 by Mariusthvdb

we started exploring that here

1 Like

Super, works apparently also with out the custom hui element.
I am adding this now to a few of my cards too, am trying to reduce dashboard scrolling since a few days, started of with the tabbed card to group cards but still stuck with the larger ones…not any more !

yes, I have set most cards to a max of 400 (500 with button crds), some long listings of entities simply cant live without that imho.

and you can also do it with grids, which is also very nice to have, especially with things like custom:button-cards (or core tiles)

for grid, you need custom:mod-card though, as it has no ha-card element:

type: vertical-stack
cards:

  - type: custom:button-card
    template: button_default_title
    name: >

      [[[ let actueel = states['sensor.actueel_verbruik_switches'].state;
          return 'Schakelaars: ' + actueel + ' W'; ]]]

    variables:
      path: home
    hold_action:
      action: navigate
      navigation_path: >
        [[[ return window.location.pathname.split('/')[2] === 'schakelaars'
            ? '/ui-sub-views/summary_groups' : '/ui-overzicht/schakelaars'; ]]]

  - type: custom:mod-card
    card_mod:
      style: |
        :host {
          max-height: 500px;
          overflow-y: scroll;
        }
    card:
      type: grid
      columns: 4
      cards:

there are several more variants I use, (eg inside a fold_entity_row, or auto-entities), but I think they’re all documented in the card-mod thread

Added value for markdown is that I can set height the same which looks a lot neater then just ‘random’

exactly. note I only added the border-top there, to set it out against the card above it, and it seems to nicely slide under that:

Mar-17-2023 08-37-14

Fancy…something for the future for me, I am still trying to get my head around which data I really want to see/use and when…I have way (!) too much to deal or care about

hehe, right, back to topic :wink: