Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changes for Homeassistant #930

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

tobilektri
Copy link

If you want to get the trips or chargings with Homeassistant RESTful Sensor into an attribute (e.g. to create a table) you need a json attribute. So we have to implement a attribute with the array to parse the trip and charge data to homeassistant.

After that you can use:

- platform: rest
  name: corsa_e_trips
  resource: http://xxxxx:5000/vehicles/trips?homeassistant=1
  scan_interval: 60
  value_template: "{{ value_json | length }}"
  json_attributes:
  - trips

While now you cant parse the json into an attribute and the value only allows 255 chars.

After that you can e.g. use flex-table-card to create a nice table with a list of your trips or charges.

If you want to get the trips with Homeassistant RESTful Sensor into an attribute (e.g. to create a table) you need a json attribute. So we have to implement a attribute with the array to parse the trip data to homeassistant
If you want to get the chargings with Homeassistant RESTful Sensor into an attribute (e.g. to create a table) you need a json attribute. So we have to implement a attribute with the array to parse the charge data to homeassistant
@tobilektri tobilektri changed the title Update api.py API changes for Homeassistant Aug 7, 2024
@flobz
Copy link
Owner

flobz commented Sep 3, 2024

have you tried this :

rest:
  - resource: "http://xxxxx:5000/vehicles/trips?homeassistant=1"
    sensor:
      - name: "trips"
        value_template: "{{ value_json|| length }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants