Badges for addon service status

no, I don’t use a proxy

use_x_forwarded_for: true
  trusted_proxies:
    - 127.0.0.1
    - ::1

These are both options for a proxy…

If you enter Https://myduckdns.org:8123 From inside your network do you get to your front end?

Have you tried copying a new token, they are prone to copy/paste errors given how long they are.

I removed the proxy settings inside my configuration.yaml and changed the long life token with new one. But the issue remain (status unknow)

Yes, I can see the front end (login page) if I connect to https://xyz.duckdns.org:8123 or https://xyz.duckdns.org from LAN and out of LAN.

With https://xyz.duckdns.org I get thiserror:

Error fetching data: <PreparedRequest [GET]> from https://xyz.duckdns.org/hassio/addon/core_samba/info failed with HTTPSConnectionPool(host='xyz.duckdns.org', port=443): Max retries exceeded with url: /hassio/addon/core_samba/info (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6eda30d0>: Failed to establish a new connection: [Errno -3] Try again'))

With https://xyz.duckdns.org:8123 I get one:

Error fetching data: <PreparedRequest [GET]> from https://xyz.duckdns.org:8123/hassio/addon/core_samba/info failed with HTTPSConnectionPool(host='xyz.duckdns.org', port=8123): Max retries exceeded with url: /hassio/addon/core_samba/info (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x71802f50>: Failed to establish a new connection: [Errno 111] Connection refused'))

Hi silvrr, I made some research and seems that other people have my same issue.
What is your Home Assistant release?
Actuallly I’m on 0.92.2

Edit: just a little request. Please, could you share your background images? I really like your frontend theme.

92.0 currently. The method has been working for quite a few releases though.

https://github.com/SilvrrGIT/HomeAssistant/blob/master/www/background2.jpg

Thanks a lot for the background image.
About addons badge: actually works on your setup?

Hi threre, Trying to work with your Addon’s Sensor… But can’t really understand what should I put inside the “Authorization:”…?

You need to create a long lived token (LLT).

The authorization is Bearer + LLT

If my long lived token was 1234456789 then

Authorization: "Bearer 123456789"

would be the correct authorization section.

To pull a LLT, go to your user screen and scroll all the way to the bottom.

Still missing one thing…

In the Profile page, when I can create a LLT, I press on “create” and get a Box to enter something… I enter “Bearer njfjMNGJdfj 4r4…” , and when I press OK, I get a new ‘code’ , much longer…

Which one I need to use ? The one I wrote with the “Bearer” or the long one I got in result?

The long one you get in result.

It’s worth noting if you use the command line sensor you can just use the existing token within HA and just use the supervisor address making the package/config much more portable.

sensor:
  - platform: command_line
    name: lms
    command: 'curl -H "Authorization: $SUPERVISOR_TOKEN" http://supervisor/addons/local_lms/info'
    value_template: '{{ value_json.data.state }}'
    scan_interval: 5
1 Like

Hi, I put this in my configuration.yaml but I keep getting this error

Template variable error: 'value_json' is undefined when rendering '{{ value_json.data.state }}

Can anyone help me?

Post the full code using code blocks

  - platform: rest
    resource: http://10.0.0.25:8123/hassio/addon/bc9cb2be_cloudflare-argo/info
    name: cloudlflareargo
    value_template: '{{ value_json.data.state }}'
    scan_interval: 60
    headers:
      Authorization: !secret cloudflare_llt
      Content-Type: application/json

What does the json look like if you open that url in a browser?

Looks like this

if you go to that URL it’s returning that? That’s not json which the rest sensor is expecting hence the error

I think you need to change the rest URL to use the API:

http://10.0.0.25:8123/api/hassio/addons/bc9cb2be_cloudflare-argo/stats

[Variations of this work for me on several add-ons]

I get this error instead.

Template variable warning: 'dict object' has no attribute 'state' when rendering '{{ value_json.data.state }}'

Looks like there will be binary sensor on the next update. Thanks everyone!