Coder Social home page Coder Social logo

tronity / homeassistant Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 4.0 31 KB

The Tronity Integration is a custom integration developed for Home Assistant, designed to enable you to monitor and utilize the data provided by Tronity. By integrating Tronity with Home Assistant, you can easily monitor your vehicle's data and create automations based on it.

Home Page: https://www.tronity.io

License: MIT License

Python 100.00%
homeassistant

homeassistant's People

Contributors

hanno-tronity avatar kurim avatar sebastian-tronity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

homeassistant's Issues

Integration with HACS

HACS (https://hacs.xyz/) is a powerful addition for HA to download and update custom/3rd party components. It would be much easier to use it instead of downloading and manually updating your code at each release, especially in this beta phase when updates will be more frequent I guess.

Irregular Error: Attempt to decode JSON with unexpected mimetype

I just discovered that there are several errors regarding the Tronity custom component in my HA logfile.
Has there been a general problem in server connectivity between 7:30 - 9:20 (CET) this morning?

Logger: homeassistant.helpers.entity
Source: custom_components/tronity/sensor.py:108
Integration: Tronity
First occurred: 07:46:03 (3 occurrences)
Last logged: 07:46:04

(Update for sensor.tronity_e2008_plugged fails
Update for sensor.tronity_e2008_remainig_range fails
Update for sensor.tronity_e2008_odometer fails
Traceback (most recent call last):
  File "/config/custom_components/tronity/sensor.py", line 103, in _async_update_data
    data = await response.json(content_type="application/json")
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1104, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://api.tronity.tech/tronity/vehicles/64477579fe825300125ca489/last_record')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 550, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 755, in async_device_update
    raise exc
  File "/config/custom_components/tronity/sensor.py", line 207, in async_update
  File "/config/custom_components/tronity/sensor.py", line 108, in _async_update_data
    raise _LOGGER(
TypeError: 'HassLogger' object is not callable)

Logger: homeassistant.helpers.entity
Source: custom_components/tronity/sensor.py:48
Integration: Tronity
First occurred: 25. April 2023 um 09:44:29 (376 occurrences)
Last logged: 09:20:03

Update for sensor.tronity_e2008_charging fails
Update for sensor.tronity_e2008_remainig_range fails
Update for sensor.tronity_e2008_odometer fails
Update for sensor.tronity_e2008_charge_remaining_time fails
Update for sensor.tronity_e2008_charger_power fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 550, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 755, in async_device_update
    raise exc
  File "/config/custom_components/tronity/sensor.py", line 207, in async_update
    data = await self.coordinator._async_update_data()
  File "/config/custom_components/tronity/sensor.py", line 93, in _async_update_data
    bearer_token = await get_bearer_token(self.client_id, self.client_secret)
  File "/config/custom_components/tronity/sensor.py", line 48, in get_bearer_token
    response_json = await response.json()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1104, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://api.tronity.tech/authentication')

Latitude and Longitude

The Tronity vehicle data contain the position data of the vehicle (if provided by the car). Is it possible to integrate these data as HA entities?

Poll Interval?

How often dues the integration make a query from the server? Only when a state change? Can i change the poll interval?

Service to force refresh

My Peugeot e208 rarely notifies on state changes, so before using tronity I was using PSA controller which allows me forcing refresh data of the car, like if I opened the official Peugeot app and tap refresh.

Would that be possible for tronity too? A HA service for that would be perfect

Altitude

on Tronity api there is a altitude data? For gps data?

No entities shown in integration information

Followed the guideline but after adding the integration it stays "empty" and shows no entities:
image

As you can see the car was identified correctly so I assume that there was some initial communication with the servers.

[EDITED COMMENT]

Installation instructions

Hi,
if I unzip downloaded github file, it will create folder homeassistant-main and put all files into it. It is not correct, so all files from that folder need to be moved up one folder.
I would recommend either to change zip file content or change instructions for installing.

Also would be nice to update instructions about Client Secret, as is written in this closed issue: #2 (comment)

Thanks for the integration!

Device with entities instead of entities only

Would be awesome to have on device per car.

all the entities should then be attached to the device. This would make it way more useable and a way better ux.

thank you for the integration

Display the Data from Drives and Chargings

Hello, is there a way to display the datas from the drives an chargings from tronity in homeassistant??
The Tronity app and tronity web is very nice ;-) but i want to use this datas in homeassistant.

Ability to change units/measurements

I love the Tronity eco system and this integration looks like a fantastic start, however, being from the UK I need to be able to change KMs to Miles in the displayed information, is this something that can be done in the background as a workaround?

Remaining charging time wrong

I have a Skoda Enyaq and the remaining charging time is to long. It seems, that the read value is seconds but is interpreted as minutes.
Entity is showing 9.300 minutes, resulting in 155 hours. Real remaining time is 2.5 hours, so appr. 9300 seconds.

"Attempt to decode JSON with unexpected mimetype" error in start up log

Hi, very useful component, since the only audi integration available doesn't get any useful data for my vehicle so thanks! I spotted this in the logs, just following a fresh restart. Its working relatively smoothly otherwise although I suspect due to the SW version on my vehicle not getting all the expected data - I don't get trip or location info for example.

Logger: custom_components.tronity
Source: helpers/update_coordinator.py:229
Integration: Tronity ([documentation](https://github.com/tronity/homeassistant), [issues](https://github.com/tronity/homeassistant/issues))
First occurred: 20:11:34 (1 occurrences)
Last logged: 20:11:34

Error requesting tronity data: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://api.tronity.tech/tronity/vehicles/XXXX/last_record')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.