Code Monkey home page Code Monkey logo

smartcharging's People

Contributors

evthefuture avatar magnussand avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

smartcharging's Issues

Add filter info when listening for events

When registering event handler add domain and entity_id.

When receiving event, match domain and entity_id from kwargs. Maybe also include pointers to handlers for different services like turn_on and turn_off

entity_id is not always of the type are in event handler

2020-12-03 17:41:07.125739 WARNING charge_ev_when_cheepest: Worker Ags: {'id': '7ed48bfe43d64657bc0c3b9410c66a27', 'name': 'charge_ev_when_cheepest', 'objectid': 'd410e9ca32734b4d8c3e76f41b8b9bac', 'type': 'event', 'event': 'call_service', 'function': <bound method SmartCharging.handle_incoming_event of <ev_charge_control.SmartCharging object at 0x7f2729ff2b80>>, 'data': {'domain': 'switch', 'service': 'turn_off', 'service_data': {'entity_id': ['switch.old_grey_charger_switch']}}, 'pin_app': True, 'pin_thread': 0, 'kwargs': {'entity_id': 'switch.charge_ev_when_cheepest_active', '__thread_id': 'thread-0'}} 2020-12-03 17:41:07.125961 WARNING charge_ev_when_cheepest: ------------------------------------------------------------ 2020-12-03 17:41:07.126356 WARNING charge_ev_when_cheepest: Traceback (most recent call last): File "/config/appdaemon/apps/ev_charge_control/ev_charge_control.py", line 264, in handle_incoming_event data_key = entity_id.replace("switch." + self.name, "~") AttributeError: 'list' object has no attribute 'replace'

missing ()

File "/config/appdaemon/apps/ev_charge_control/ev_charge_control.py", line 276, in handle_incoming_event self.get_main_log.exception(f"Exception when handling event") AttributeError: 'function' object has no attribute 'exception'

Smart Charging Status Switch - reporting unexpected values.

Switch for Enable/Disable Smartcharging is reporting "Disabled by user" when there is no need to charge and switch is on.

image

Values are retained even when switch have been toggled.

image

IMO time slots should be removed when switch -> off. And recalculated when switch changes state to on.
Then we should always end up with a valid state.

The name should also be changed so it's not the same as the sensor. :).

(Or it's just that they are in some states are displaying the same information which makes it a little confusing.)

App does not handle when integration is unable to communicate with car.

For some reason car couldn't be woken when charging should begin.

The app reports charging but it never succeed with the command to the car.

Not sure if you can get any status back, or we just need to check it.

image
image
image

2020-12-05 23:07:06 ERROR (MainThread) [teslajsonpy.controller] Giving up command(...) after 2 tries (teslajsonpy.exceptions.RetryLimitError)
2020-12-05 23:07:06 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall switch.turn_on (c:f9f491efe28a1a25ea075c8d871a89a1): entity_id=['switch.old_grey_charger_switch']>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1461, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 593, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 630, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/tesla/switch.py", line 32, in async_turn_on
    await self.tesla_device.start_charge()
  File "/usr/local/lib/python3.8/site-packages/teslajsonpy/homeassistant/charger.py", line 64, in start_charge
    data = await self._controller.command(
  File "/usr/local/lib/python3.8/site-packages/backoff/_async.py", line 133, in retry
    ret = await target(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/teslajsonpy/controller.py", line 476, in command
    return await self.post(
  File "/usr/local/lib/python3.8/site-packages/teslajsonpy/controller.py", line 174, in wake_up
    raise RetryLimitError("Reached retry limit; aborting wake up")
teslajsonpy.exceptions.RetryLimitError
2020-12-05 23:53:36 INFO (MainThread) [teslajsonpy.controller] Backing off command(...) for 12.7s (teslajsonpy.exceptions.RetryLimitError 

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.