Skip to content

Car Charging doesn't use sensor #9

Description

@paulgee31

Looking at the prebat.py 4.0 source, I can't see any code to handle the responses listed in apps.yaml? Am I missing some aspect to how the car charging prediction now works?

Setting the car_charging_planned to a sensor results in:
INFO pred_bat: WARN: Return bad int value EV Disconnected from car_charging_planned
2023-06-02 12:14:21.136105 INFO pred_bat: Previous message repeated 848 times

apps.yaml
car_charging_planned_response:
- 'yes'
- 'on'
- 'true'
- 'connected'
- 'ev connected'
- 'charging'
- 'paused'
- 'waiting for car demand'
- 'scheduled'
- 'enabled'
- 'latched'
- 'locked'
- 'plugged in'

predbat.py:
planned = self.get_arg('car_charging_planned', False)
if isinstance(planned, str):
if planned.lower() in self.get_arg('car_charging_planned_response', ['yes', 'on', 'enable', 'true']):
planned = True
else:
planned = False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions