Giter Site home page Giter Site logo

eo_mini's People

Contributors

hallidaydaniel avatar twhittock avatar twhittock-disguise avatar zackslash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eo_mini's Issues

Change charging rate

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.

Charging state

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?

Entities suddenly unavailable, reinstall not resolving.

Version of the custom_component

38f9569

Configuration

NA - logged in as per instructions

Describe the bug

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

Log Entries

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(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

state_class total_increasing has set last_reset

Version of the custom_component

Latest Version

Describe the bug

As below in the logs from HA using the state_class_total_increasing incorrectly.

Debug log


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.

Time Entities for charge schedule

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 -

  • Off Peak Weekday Start
  • Off Peak Weekday End
  • Off Peak Weekend Start
  • Off Peak Weekend End
  • Solar Start
  • Solar End
  • Schedule Time Start
  • Schedule Time End

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:

  • overlapping times between entities - how should this be handled / blocked
  • before adding a new time period the old one is going to need to be blanked out with 0s some how so you don't end up with an old and new block in the schedule
  • The EO app on iOS at least lets you set everything before it is pushed to the server but Home Assistant does changes straight away which isn't ideal when you have linked entities like start/end time and things as above that you don't want to overlap

Should also add itertools.cycle might help with the rotating past midnight issue, and might simplify some things.

Current consumption

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 :)

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.