twhittock / eo_mini Goto Github PK
View Code? Open in Web Editor NEWEO Mini integration for Home Assistant
License: MIT License
EO Mini integration for Home Assistant
License: MIT License
Describe the solution you'd like
Is it possible to change the charging rate of the EO Mini Pro 2? I don't have the option in the app but I know the EO installers have access to this.
Is it possible to add an update to this plugin to know when the charger is charging Vs not charging ? Maybe something like check the charging rate?
NA - logged in as per instructions
Having used this integration for months with no issues, all entities suddenly became unavailable around 2am.
No improvements were noticed on reloading the entity, restarting HA, removing the entity and HACS integration, and reinstalling. Despite being able to log in OK via the UI, now no entities are shown. iOS EO app works fine, so presume that the problem is not with EO?
Home Assistant 2023.8.0
Supervisor 2023.07.1
Operating System 10.4
Frontend 20230802.0 - latest
2023-08-04 11:42:31.423 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration eo_mini which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
...
2023-08-04 11:43:07.134 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform eo_mini
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
device = dev_reg.async_get(self.hass).async_get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'serial'
2023-08-04 11:43:07.644 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up eo_mini platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 370, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
device = dev_reg.async_get(self.hass).async_get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'serial'
2023-08-04 11:43:07.736 ERROR (MainThread) [homeassistant.components.switch] Error adding entities for domain switch with platform eo_mini
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
device = dev_reg.async_get(self.hass).async_get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'serial'
2023-08-04 11:43:07.741 ERROR (MainThread) [homeassistant.components.switch] Error while setting up eo_mini platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 370, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
device = dev_reg.async_get(self.hass).async_get_or_create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Latest Version
As below in the logs from HA using the state_class_total_increasing incorrectly.
2023-01-12 07:21:06.387 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.eo_mini_pro_2_consumption (<class 'custom_components.eo_mini.sensor.EOMiniChargerSessionEnergySensor'>) with state_class total_increasing has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured, otherwise report it to the custom integration author.
2023-01-12 07:21:06.412 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.eo_mini_pro_2_charging_time (<class 'custom_components.eo_mini.sensor.EOMiniChargerSessionChargingTimeSensor'>) with state_class total_increasing has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured, otherwise report it to the custom integration author.
I mentioned this before, and just wanted to note it here, as I'm going to be away for a while, so not likely to get to this soon, in case it helps anyone else looking at it.
Time entities are in the new 2023.6 release - https://www.home-assistant.io/blog/2023/06/07/release-20236/#new-entities-date-time-datetime - hopefully they will be able to set some sort of step so minutes can change only to 00 or 30, but I haven't looked.
As I see things there are probably 8 entities to add -
I had some thoughts / random notes on how the schedule could be handled (feel free to ignore all of this, I just wanted to note it somewhere in case it helps)
from datetime import time
st = time(11, 0)
et = time(16, 30)
sidx = int(st.hour * 2 + st.minute / 30)
eidx = int(et.hour * 2 + et.minute / 30)
sched = 'PPP0000000000000000000SSSSSSSSSS00000000000PPPPP00'
# Adding new schedule when start time < end time
If the string is loaded to a list it can be indexed and may be easier for manipulation
sched_list = list(sched)
sched_list.pop() # 2 times to remove last two 0 as they aren't used
sched_list[sidx:eidx]= "S" * (eidx - sidx)
sched = "".join(sched_list)
sched = sched + "00" # need to add the 00s back on
sched
'PPP0000000000000000000SSSSSSSSSSSS000000000PPPPP00'
if sidx > eidx: # The time period loops past midnight
sched_list[0:eidx-1] = "T" * (eidx-1)
sched_list[sidx:len(sched_list)] = "T" * (len(sched_list) - sidx)
start time from string to time object -
>>> time(sched.index("S") // 2, (sched.index("S") % 2) * 30)
datetime.time(11, 0)
end time from string to time object -
>>> time(sched.rindex("S") // 2, (sched.rindex("S") % 2) * 30)
datetime.time(15, 30)
Checking current time schedule...
sched_list[0] == sched_list[-1] # indicates the schedule loops past midnight
Still need something to read start / end time when it loops around midnight
Off peak - "P"
Scheduled Time - "T"
Solar - "S"
Things that might need to be taken in to account:
Should also add itertools.cycle might help with the rotating past midnight issue, and might simplify some things.
I previously had an EO Mini which was linked to the Enel X (JuiceNet) Platform. The integration exposed an "Car Charger Power" entity which gave an estimate of the point in time power the car was drawing. This allowed me to add that to the Power Flow Car Plus card as secondary information so i could see live what was being pulled but also minus the car usage from the home usage.
Looking at the EO Smart Home app it also has a "EV Charge Rate" value displayed within the app. I've put the app through a proxy to intercept the requests and observed the following:
GET //api/session/ HTTP/1.1
And the response:
HTTP/1.1 200 OK
Content-Length: 228
<headers>
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
{"USID":13533350,"CPID":20356,"PiTime":1702464297,"ESTime":0,"ESCost":0,"**ESKWH":422360**,"ChargingTime":60,"PayR1":0,"PayR2":0,"PayR3":0,"PayR4":0,"ULoc":"","Location":"EO Mini","Voltage":230,"IsPaused":false,"IsOverridden":false}
I think the ESKWH value matches to the estimated power being pulled by the charger at that point in time.
I'm not sure if its possible to expose this value as an entity?
Thanks :)
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.