Github Integration

Probably a dumb idea but I thought I’d look at using a Github sensor instead of rest sensors to get some version information for some github repos.

ok why isn’t this working?

  - platform: github
    access_token: !secret github-access-token
    entity_namespace: github
      - path: 'artisan-roaster-scope/artisan'
        name: Github Artisan
      - path: 'docker/compose'
        name: Github Docker Compose
      - path: 'arendst/Tasmota'
        name: Github Tasmota

It uses the name for the friendly name but it’s supposed to overide the sensor name as well.
It is ignoring the namespace
I am getting sensor.artisan, sensor.compose, etc why not sensor.github.artisan etc??

i dont use this sensor, but it appears that it’s naming the entity based off the repo name, not the user/repo or org/repo like maybe you’re expecting?
Also, going off the documentation, entity_namespace isn’t a valid thing.

It works for other integrations. It is valid.

Yeah but the docs specifically say you can overide that.

I was an artisan cacao bean roaster at one point in my life. This would have been very useful tool.

1 Like

hm, never knew about the entity_namespace, is it getting deprecated?

These options are being phased out and are only available for single platform integrations.

Don’t know… maybe…
Docs here if anyone is interested:

The docs for the integration seem to say it should work with the friendly name anyway… It’s just annoying I suppose but not really a big deal.

using this myself (and note the HA repo from the example in the documentation doesn’t create a sensor…whihc is remarkable to say the least:

  - platform: github
    access_token: !secret github_token
    entity_namespace: Github
    scan_interval: 3600
      - 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
      - path: custom-cards/bignumber-card
        name: Big number
      - path: custom-cards/button-card
        name: Button
      - path: thomasloven/lovelace-card-mod
        name: Card mod
      - path: thomasloven/lovelace-card-tools
        name: Card tools
#      - path: custom-cards/config-template-card
#        name: Config template
      - path: maykar/custom-header
        name: Custom header
#      - path: iammexx/home-assistant-config/tree/master/ui/darksky
#        name: Darksky weather card
      - path: custom-cards/decluttering-card
        name: Decluttering
      - path: custom-cards/entity-attributes-card
        name: Entity attributes
      - path: thomasloven/lovelace-fold-entity-row
        name: Fold entity row
      - path: custom-cards/gauge-card
        name: Gauge
      - path: custom-cards/group-card
        name: Group
      - path: thomasloven/lovelace-layout-card
        name: Layout card
      - path: DBuit/light-popup-card
        name: Light popup
      - path: iantrich/list-card
        name: List
      - path: gadgetchnnel/lovelace-card-templater
        name: Card templater
      - path: kalkih/mini-graph-card
        name: Mini graph
      - path: kalkih/mini-media-player
        name: Mini media player
      - path: benct/lovelace-multiple-entity-row
        name: Multiple entity row
      - path: gurbyz/power-wheel-card
        name: Power wheel
      - path: iantrich/restriction-card
        name: Restriction
      - path: custom-cards/secondaryinfo-entity-row
        name: Secondary info row
      - path: kalkih/simple-weather-card
        name: Simple weather
      - path: thomasloven/lovelace-slider-entity-row
        name: Slider entity row
      - path: thomasloven/lovelace-state-switch
        name: State switch
#      - path: bramkragten/custom-ui/tree/master/swipe-card
#        name: Swipe
      - path: thomasloven/lovelace-template-entity-row
        name: Template entity row
#      - path: rodrigofragadf/lovelace-cards/tree/master/tiles-card
#        name: Tiles
      - path: thomasloven/lovelace-toggle-lock-entity-row
        name: Toggle lock entity row
      - path: ofekashery/vertical-stack-in-card
        name: Vertical stack in card
      - path: royto/waze-card
        name: Waze
      - path: sgttrs/lovelace-weather-card-chart
        name: Weather card chart

which works perfectly, except for the commented repos, which cause the complete sensor to stop being created. Just filed an issue for that.
error displayed:

GitHub error for custom-cards/config-template-card: 401 {'message': 'Bad credentials', 'documentation_url': ''}

displaying these in the frontend with:

  - type: custom:auto-entities
      type: entities
#      title: Github repos
      show_header_toggle: false
        type: picture
        image: /local/images/github_owler.png
      - entity: automation.github_repo_update
        secondary_info: last-triggered
        - entity_id: sensor.github*
#            tap_action:
#              action: more-info
            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')}}

only wish left is to have a tap_action, which now isn’t availble on the template-entity-row. Ive asked Thomas, but hasn’t responded yet.

even got an automation to notify of a change:


  - alias: 'GitHub repo update'
      platform: event
      event_type: state_changed
      - condition: template
        value_template: >
      - condition: template
        value_template: >
          {{ 'old_state' in and 'new_state' in and
      service: notify.system
        title: Github repo update
        message: >
         {{state_attr(, 'name')}} was updated to {{state_attr(, 'latest_release_url').split('tag/')[1]}}.
         Visit the release page {{state_attr(, 'latest_release_url')}} to download.

So you do have the entity_namespace working? I just can’t make that work. Do you see an error with my configuration in first post?

oddly enough Ive just discovered only the home-assistant sensor is not getting the prefix Github, all the others do.

only difference I see is you quote all repos, and I left that out.

did you check the correct setting for the credential, like the docs state? Sure you did, just checking the only thing that could go wrong…

Yeah I removed the quote as per your example. My token seems to be working - all sensors created it just ignores the entity_namespace for some inexplicable reason

maybe add it to the issue n Github. I’ve done that today for another issue (invalid repos blocking the full sensor creation for all the valid ones) and the author is having a look. Maybe he can check this too while he’s at it :wink:

I already created an issue for this here: