Other way to automatically signal for custom-cards updates than HACS?

that’s what I referred to indeed.

and the file locations for the custom-cards. As said, I tried HACS some time ago, and then there was some struggle to move to the new location for community, and referencing to these locations. Im still using the ‘old’ location, in the www folder.

About system performance: as always your mileage may vary. I use the HUE integration. that loses the connection to the hub and consequently lights whenever the system gets stressed. At the time, HACS was a serious affecting this, as where the other mentioned CC’s. Since taking these out, things have quieted down significantly.

Getting back to my original question for finding an alternative to HACS, I now have set up GitHub sensors for the custom cards:

sensor:
  - platform: github
    access_token: !secret github_token
    entity_namespace: Github
    scan_interval: 3600
    repositories:
      - path: home-assistant/home-assistant
        name: Home-assistant
      - path: thomasloven/hass-browser_mod
        name: Browser mod
      - path: dnguyen800/air-visual-card
        name: Air visual
      - path: thomasloven/lovelace-auto-entities
        name: Auto entities
      - path: custom-cards/bar-card
        name: Bar
etc etc etc

and display these in the frontend with:

  - type: custom:auto-entities
    card:
      type: entities
      title: Github repos
      show_header_toggle: false
    filter:
      include:
        - entity_id: sensor.github*
          options:
            type: custom:template-entity-row
            state: >
              {% if state_attr(config.entity,'latest_release_url') %}
              {{ state_attr(config.entity,'latest_release_url').split('tag/')[1]}}
              {% else %} Not set
              {% endif %}
            secondary: "{{ as_timestamp(states[config.entity].last_changed)| timestamp_custom('%X - %D') }}"
          sort:
            method: name


still need to find my way to the more-info (now clicking isn’t possible yet), and some way to automatically alert when the {{ state_attr(config.entity,‘latest_release_url’).split(‘tag/’)[1]}} has changed. Seems feasible, but will be for tomorrow…

1 Like

The mini-media-player-bundle was updated yesterday when I posted this.

It’s not just me. There are plenty of recent posts on the button-card and thread about people THINKING they had a new version but didn’t and as I said, there is a github issue.

Yeah but I have never reverted a card.
Next time I have an update I will post screenshots seeing that seems to be the only proof acceptable to some people. After 3 years I think I know my way around HA pretty well… anyway…

Seems you are well on the way… I was using rest sensors to get the latest tag and then I was parsing the lovelace yaml file to get the current installed. It didn’t ‘do’ anything else other than visually show there was an update available.

not knocking your abilities. I’m just speaking from experience and my understanding of code. Also, I know how it works in regards to updating. It bases its updates on the releases OR the latest fix. The drop down determines that. If you aren’t paying attention to the drop down and update, you could just be installing the same version. Not to mention cache comes into play. If you don’t have a ? at the end of your resource, the browser may not use the update.

So all in all, I’d need to see ALL that information before I say it’s a bug.

There is a github issue with logs etc…
I am actually checking the downloaded code with the previous downloaded code so it’s not a resources issue.
I am well aware how it is supposed to work with releases or latest commit.

If I restart Home Assistant and then tell HACS to reinstall it pulls the right version without changing anything else.

I don’t need you to agree it’s a bug…

where is it? I just went through all the issue and I didn’t find it.

No, you certainly don’t. I would help you… but your attitude is turning me away.

HACS not updating some cards · Issue #944 · hacs/integration · GitHub closed as it has the same cause as a different still open issue.

you might need a mirror

This is a possible temp fix:

Try selecting "master", then selecting the nevest version, the click the tree dots -> reload data.
Then update"

I’ll try that next time

Please point out where I was malicious towards you.

Here’s you pulling context out of nowhere, acting like I called you an idiot:

Not once did I question your abilities. I simply explained how it worked. Maybe I could have phrased this

better but it still didn’t warrant your asinine responses.

It seems like you have a chip on your shoulder and you don’t like it when someone explains something.

The implication being I don’t understand how it works…

Um… no. Do you have a chip on yours?

Anyway… look… lets call a truce. Maybe I over reacted. I’ve been frustrated by this bug for weeks so maybe I’m a bit sensitive about it…

1 Like

yes, have the tag for most cards now, and some dont have it set as you can see (btw, are these in HACS…?)

now how do you do that? Can we parse a config file and template anything into the frontend/backend?
would be the final step to take here…

I was using a shell script… I’ll dig it out tomorrow… it was pretty straightforward.

thanks, no worries, no rush.

meanwhile I took the last_changed out (since it adds nothing really other than the last time the system is restarted…) and replaced it with the latest commit message, so I can see in a glance what was changed.

  - type: custom:auto-entities
    card:
      type: entities
      title: Github repos
      show_header_toggle: false
    filter:
      include:
        - entity_id: sensor.github*
          options:
            type: custom:template-entity-row
            state: >
              {% if state_attr(config.entity,'latest_release_url') %}
              {{ state_attr(config.entity,'latest_release_url').split('tag/')[1]}}
              {% else %} Not set
              {% endif %}
            secondary: >
              {{ state_attr(config.entity,'latest_commit_message')}}

first effort for an automation:

  - alias: 'GitHub repo update'
    trigger:
      platform: event
      event_type: state_changed
    condition:
      - condition: template
        value_template: >
          {{ trigger.event.data.entity_id.startswith('sensor.github')}}
      - condition: template
        value_template: >
          {{ 'old_state' in trigger.event.data and 'new_state' in trigger.event.data and
             trigger.event.data.new_state.attributes.latest_release_url !=
             trigger.event.data.old_state.attributes.latest_release_url }}
    action:
      service: notify.marijn
      data_template:
        title: Github repo update
        message: >
          {{trigger.event.data.entity_id}} was updated to {{trigger.event.data.entity_id.attributes.latest_release_url.split('tag/')[1]}}
1 Like

slight little nudge here… found it yet David? just being anxious to try…

Ugh. I’ll look today.

1 Like

Here is the script

#!/bin/bash

cd "$(dirname "$0")"

lovelace_cards=$(cat ui-lovelace.yaml)
darksky_card=$(echo "$lovelace_cards" | grep "dark-sky-weather-card" | head -1 | sed "s/.*\/dark-sky-weather-card.js?v=//")

# Build JSON output
card_installed_string='{"state":"","attributes":{"darksky":"'"$darksky_card"'"}}'

# Home Assistant Config
creds=$(cat abbusage/abbcreds.json)
server=$(echo "$creds" | jq -r '.server')
token=$(echo "$creds" | jq -r '.token')

# Publish to HA with token
curl -X POST -H "Authorization: Bearer $token" \
     -H "Content-Type: application/json" \
     -d "$card_installed_string" \
     "$server"/api/states/sensor.lovelace_card_installed

I had the credentials stored in anoter file along with a token. I also was reading other cards originally but removed them as they were added to HACS but you get the idea. It reads the lovelace yaml file to get the current installed version… just parses resources section.

The lovelace code to display is here:

          - type: 'custom:config-template-card'
            variables:
              - states['sensor.lovelace_card_installed'].state
              - states['sensor.lovelace_card_installed'].attributes['darksky']
            entities:
              - sensor.hacs
              - sensor.darksky
            card:
              type: 'custom:hui-entities-card'
              title: "👀 Available Card Versions"
              show_header_toggle: false
              entities:
                - entity: sensor.hacs
                  name: HACS
                - entity: sensor.darksky
                  name: "${'Darksky installed:' + '\xa0'.repeat(6) + vars[1] + '\xa0'.repeat(3) + 'Available:'}"
                  icon: mdi:weather-partlycloudy

Also… HACS bug seems resolved now.

ok thanks David,
need some time to consume this.

Id need a way to read the resources.yaml file, and find the version number of each loaded resource, to compare those with the tag my GitHub sensors extract from the repo’s…

not immediately obvious how I should handle the, so please let me think on that …

The script will read any file you want it to read and extract the version. It’s all in the script.

ok, will test.

could I expand this to read all version numbers for all listed resources?

like:

lovelace_cards=$(cat resources.yaml)
darksky_card=$(echo "$lovelace_cards" | grep "dark-sky-weather-card" | head -1 | sed "s/.*\/dark-sky-weather-card.js?v=//")

button_card=$(echo "$lovelace_cards" | grep "button-card" | head -1 | sed "s/.*\/button-card.js?v=//")

etc

# Build JSON output
card_installed_string='{"state":"","attributes":{"darksky":"'"$darksky_card"'"}}'
card_installed_string='{"state":"","attributes":{"button":"'"$button_card"'"}}'
etc

Yes definitely. When I started with the script I had a bunch of cards in there. I just posted my latest version before I didn’t need it anymore as everything I used was in HACS.

Also… I have been using rest sensors to suck data out of github and didn’t realise there was a github integration I could use. Going to try that as I think the rest sensors slow down ha when it starts - and a bunch of log messages about rest platform taking more than 10 seconds… so thanks.

ok great, will do that. 1 more questions for now then:
should I change the ‘card_installed_string’ in that case to

card_installed_string_darksky
card_installed_string_button
card_installed_string_etc

or isn’t that necessary when referecing that later on in the script:

     -d "$card_installed_string" \
     "$server"/api/states/sensor.lovelace_card_installed

please assist me here, making this script a multi liner :wink: