creatingwake / ha-indrav2h Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Implement a SelectEntity to display current charger mode, and enable the mode to be easily switched within HA.
0.0.3
Add your logs here.
Sensors with numeric values are not able to be graphed by HA.
Need to add appropriate SensorDeviceClass
for relevant sensors in sensor.py
e.g.
from homeassistant.const import BATTERY
...
...
sensors.append(
IndraV2hSensor(
coordinator,
entry,
create_meta("Vehicle State Of Charge", "soc", icon="mdi:car-electric", device_class=BATTERY),
)
)
Likely that unit
will also need to be specifically stated as per: https://developers.home-assistant.io/docs/core/entity/sensor/
If specifying a device class, your sensor entity will need to also return the correct unit of measurement.
Add your logs here.
0.0.2
Using config flow and entered my V2H smart portal log in.
I get the following errors when setting up the integration whilst the vehicle isn't connected. Probably need some sort of error handling when vehicle isn't connected.
2024-04-08 15:18:32.111 CRITICAL (MainThread) [custom_components.indrav2h] Test Indra credentials
2024-04-08 15:18:32.361 INFO (MainThread) [homeassistant.setup] Setting up indrav2h
2024-04-08 15:18:32.361 INFO (MainThread) [homeassistant.setup] Setup of domain indrav2h took 0.0 seconds
2024-04-08 15:18:32.362 INFO (MainThread) [custom_components.indrav2h]
-------------------------------------------------------------------
Indra V2H
Version: 0.0.2
This is a custom integration!
If you have any issues with this you need to open an issue here:
https://github.com/creatingwake/ha-indrav2h/issues
-------------------------------------------------------------------
2024-04-08 15:18:32.889 ERROR (MainThread) [custom_components.indrav2h] Traceback (most recent call last):
File "/config/custom_components/indrav2h/__init__.py", line 91, in _async_update_data
return await self.api.refresh()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hclient.py", line 19, in refresh
await self._device.refresh_stats()
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hdevice.py", line 44, in refresh_stats
a = await self.connection.get("/transactions/" + self.serial +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 72, in get
return await self.send("GET", url, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 68, in send
raise V2HException(response.status_code)
pyindrav2h.exceptions.V2HException
2024-04-08 15:18:32.889 ERROR (MainThread) [custom_components.indrav2h] Error fetching indrav2h data:
File "/config/custom_components/indrav2h/__init__.py", line 91, in _async_update_data
return await self.api.refresh()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hclient.py", line 19, in refresh
await self._device.refresh_stats()
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hdevice.py", line 44, in refresh_stats
a = await self.connection.get("/transactions/" + self.serial +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 72, in get
return await self.send("GET", url, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 68, in send
raise V2HException(response.status_code)
pyindrav2h.exceptions.V2HException
2024-04-08 15:18:38.826 ERROR (MainThread) [custom_components.indrav2h] Error fetching indrav2h data:
2024-04-08 15:18:49.627 ERROR (MainThread) [custom_components.indrav2h] Traceback (most recent call last):
File "/config/custom_components/indrav2h/__init__.py", line 91, in _async_update_data
return await self.api.refresh()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hclient.py", line 19, in refresh
await self._device.refresh_stats()
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hdevice.py", line 44, in refresh_stats
a = await self.connection.get("/transactions/" + self.serial +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 72, in get
return await self.send("GET", url, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 68, in send
raise V2HException(response.status_code)
pyindrav2h.exceptions.V2HException
2024-04-08 15:18:49.627 ERROR (MainThread) [custom_components.indrav2h] Error fetching indrav2h data:
2024-04-08 15:19:10.552 ERROR (MainThread) [custom_components.indrav2h] Traceback (most recent call last):
File "/config/custom_components/indrav2h/__init__.py", line 91, in _async_update_data
return await self.api.refresh()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hclient.py", line 19, in refresh
await self._device.refresh_stats()
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hdevice.py", line 44, in refresh_stats
a = await self.connection.get("/transactions/" + self.serial +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 72, in get
return await self.send("GET", url, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 68, in send
raise V2HException(response.status_code)
pyindrav2h.exceptions.V2HException
2024-04-08 15:19:10.553 ERROR (MainThread) [custom_components.indrav2h] Error fetching indrav2h data:
2024-04-08 15:19:51.589 ERROR (MainThread) [custom_components.indrav2h] Traceback (most recent call last):
File "/config/custom_components/indrav2h/__init__.py", line 91, in _async_update_data
return await self.api.refresh()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hclient.py", line 19, in refresh
await self._device.refresh_stats()
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/v2hdevice.py", line 44, in refresh_stats
a = await self.connection.get("/transactions/" + self.serial +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 72, in get
return await self.send("GET", url, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyindrav2h/connection.py", line 68, in send
raise V2HException(response.status_code)
pyindrav2h.exceptions.V2HException
2024-04-08 15:19:51.589 ERROR (MainThread) [custom_components.indrav2h] Error fetching indrav2h data:
0.0.0
Add your logs here.
Add SELECT support for new modes added to pyindrav2h v0.0.4 : EXPORT_MATCH, CHARGE, DISCHARGE
Add your logs here.
Is your feature request related to a problem? Please describe.
Is there any chance that you could include the charge/discharge rate entity please? It would be useful for me to be able to set a lower discharge rate to avoid going over my export power limit.
Describe the solution you'd like
A rate entity to set the charge & discharge parameters applicable to the CHARGE and DISCHARGE modes.
Describe alternatives you've considered
n/a
Additional context
Add any other context or screenshots about the feature request here.
v 0.0.0
Calling a refresh method when a BearerToken has not been requested results in an auth failure. The system should handle this exception gracefully and request a BearerToken.
Calling a refresh method when a BearerToken has expired results in an auth failure. The system should handle this gracefully and attempt to request a new BearerToken.
I have added integration. Then put my password for indra portal is that correct but keeps saying failed setup will try again? I am on v2h but using the original v2g is that the reason wont work? Or am i using a wrong email and password? Its ok its now sorted itself many thanks
0.0.3
Add your logs here.
Traceback and KeyError thrown periodically throughout the day.
Car has remained plugged in throughout.
Failures do not correlate with any automations firing or manual configuration changes.
Suspect periodic missing data in Indra API response, although the python lib is not firing a Traceback or exception so likely we are getting a 200 OK back from Indra API, just with missing data points.
Might need additional error logging to be added temporarily in pyindrav2h
Logger: homeassistant
Source: custom_components/indrav2h/select.py:52
Integration: Indra V2H ([documentation](https://github.com/creatingwake/ha-indrav2h), [issues](https://github.com/creatingwake/ha-indrav2h/issues))
First occurred: 8 April 2024 at 21:51:46 (21 occurrences)
Last logged: 15:36:15
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 243, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 399, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 479, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 999, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 947, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 151, in state
current_option = self.current_option
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/indrav2h/select.py", line 52, in current_option
return self.device.mode
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyindrav2h/v2hdevice.py", line 74, in mode
return self.stats["mode"]
~~~~~~~~~~^^^^^^^^
KeyError: 'mode'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.