Skip to content

Instantly share code, notes, and snippets.

@JBoye
Last active July 12, 2023 12:49
Show Gist options
  • Save JBoye/3df5008a83c43a21b26d870e7e654e0a to your computer and use it in GitHub Desktop.
Save JBoye/3df5008a83c43a21b26d870e7e654e0a to your computer and use it in GitHub Desktop.
Charge Finder
sensor:
- platform: rest
name: Clever Aarhus Havn
resource: https://api.chargefinder.com/status/pjyd79
scan_interval: 120
value_template: '{{ value_json|selectattr("status", "eq", 2)|list|length }}'
headers:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.59
origin: https://chargefinder.com
@ctih
Copy link

ctih commented Jan 16, 2023

Hej @JBoye
Jeg syntes ikke jeg kan få noget data fra denne ChargeFinder i Home Assistant. Skal koden opdateres?

@JBoye
Copy link
Author

JBoye commented Jan 17, 2023

@ctih Ja, prøv lige igen med opdateringen

@ctih
Copy link

ctih commented Jan 19, 2023

@ctih Ja, prøv lige igen med opdateringen

Ja det virker helt fint nu. 👍

@danielolsson100
Copy link

danielolsson100 commented Jul 12, 2023

The code need some minor changes. This works for me.

- platform: rest
    name: Ionity Helsingborg
    resource: https://api.chargefinder.com/status/z9xjy
    scan_interval: 120
    value_template: '{{ (value_json | selectattr("status", "eq", 2) | list | length) | int }}'
    state_class: measurement
    headers:
      User-Agent: Home Assistant
      Origin: https://chargefinder.com
      Content-Type: application/json`

@JBoye
Copy link
Author

JBoye commented Jul 12, 2023

@danielolsson100 Can you try the updated version (with origin: https://chargefinder.com)?

@danielolsson100
Copy link

@danielolsson100 Can you try the updated version (with origin: https://chargefinder.com)?

Yes I have already found the issue and posted a solution for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment