diff --git a/README.md b/README.md index f1e3d79..527e18b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,69 @@ -# ha-chargepoint +# ChargePoint for Home Assistant A cloud-polling Home Assistant component to expose ChargePoint Home Charger and Account information. ![home assistant entities](https://github.com/mbillow/ha-chargepoint/raw/main/.github/images/ha_chargepoint_sensor_card.png) + +## Installation + +While we are waiting to get included in the default HACS repositories, you can +manually include this repository in HACS: + +1. If you haven't already installed HACS, follow [their instructions](https://hacs.xyz/docs/setup/prerequisites). +2. Navigate to HACS. +3. Choose "Integrations" +4. Add this repository to your configuration. + 1. Click the three dots in the upper right-hand corner. + 2. Select "Custom repositories" + 3. Enter `mbillow/ha-chargepoint` into the repository box. + 4. Select the "Integration" type. + 5. Click `Add`. +5. Install the integration like you would [any other HACS addon](https://hacs.xyz/docs/navigation/overview). + +## Usage + +Once you have installed the component, you'll need to add and configure it. From the +`Configuration > Devices & Services` page, click `+ Add Integration` in the bottom +right. + +Search for ChargePoint and select the integration. You will be prompted for your +ChargePoint credentials. + +Once you are logged in, if you have any home chargers, you will be asked which zones/rooms +to assign each device to. Otherwise, you will just see a sensor exposing your account +balance. + + +## Energy Tracking + +**Must be using `v0.1.2` or higher for proper sensor classification.** + +For users that have one or more ChargePoint Home Flex(es), you can add your chargers as +sources of grid consumption in Home Assistant's energy tracking system. Simply add the +`Energy Output` output sensor of your device and add the `Charge Cost` sensor an "entity +tracking the total costs." + +## Using with Third-Party Cards + +The sensors created by this component can be used with third-party EV charging +cards like [tmjo/charger-card](https://github.com/tmjo/charger-card). + +Feel free to create Pull Requests adding demo configurations to this section of +the README if you end up building something you'd like to share. + + +## Development and Contributing + +If you notice any issues, please create a GitHub issue describing the error and include +any error messages or stack traces. + +### Running the Integration + +I've included a simple Docker Compose file that will launch a new Home Assistant instance +with the integration and its dependencies pre-installed. Simply run: + +```shell +docker-compose up -d +``` + +Then navigate to `http://127.0.0.1:8123` in your browser. \ No newline at end of file diff --git a/custom_components/chargepoint/const.py b/custom_components/chargepoint/const.py index 8dd7513..707820b 100755 --- a/custom_components/chargepoint/const.py +++ b/custom_components/chargepoint/const.py @@ -6,7 +6,7 @@ NAME = "ChargePoint" DOMAIN = "chargepoint" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "0.1.1" +VERSION = "0.1.2" ATTRIBUTION = "Data provided by https://www.chargepoint.com" ISSUE_URL = "https://github.com/mbillow/ha-chargepoint/issues" diff --git a/custom_components/chargepoint/manifest.json b/custom_components/chargepoint/manifest.json index fccb620..ea5270b 100755 --- a/custom_components/chargepoint/manifest.json +++ b/custom_components/chargepoint/manifest.json @@ -8,6 +8,6 @@ ], "config_flow": true, "issue_tracker": "https://github.com/mbillow/ha-chargepoint/issues", - "version": "0.1.1", + "version": "0.1.2", "iot_class": "cloud_polling" } diff --git a/custom_components/chargepoint/sensor.py b/custom_components/chargepoint/sensor.py index d1e1457..0a1a28f 100755 --- a/custom_components/chargepoint/sensor.py +++ b/custom_components/chargepoint/sensor.py @@ -227,7 +227,7 @@ def native_value(self): key="session_cost", name_suffix="Charge Cost", icon="mdi:cash-multiple", - state_class=SensorStateClass.MEASUREMENT, + state_class=SensorStateClass.TOTAL_INCREASING, device_class=SensorDeviceClass.MONETARY, value=lambda entity: f"{entity.session.total_amount:.2f}" if entity.session