Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/dot-github/workflows/pre-comm…
Browse files Browse the repository at this point in the history
…it-3.3.3
  • Loading branch information
CJNE authored Sep 12, 2023
2 parents 4b98e11 + 7e04121 commit 0f6d728
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pip==23.0.1
pre-commit==3.3.3
black==23.3.0
black==23.7.0
flake8==6.0.0
reorder-python-imports==3.9.0
reorder-python-imports==3.10.0
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run release-drafter
uses: release-drafter/release-drafter@v5.23.0
uses: release-drafter/release-drafter@v5.24.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[![Community Forum][forum-shield]][forum]

myenergi custom component for [Home Assistant](https://home-assistant.io).
This component will make all [myenergi](https://myenergi.com) devices connected to your hub accessible in Home Assistant.
This component will make all supported [myenergi](https://myenergi.com) devices (libbi is not currently supported) connected to your hub accessible in Home Assistant.
The energy sensors are fully compatible with the energy dashboard in Home Assistant.

It will create HA devices depending on what you have installed:
Expand All @@ -25,13 +25,13 @@ It will create HA devices depending on what you have installed:
- Grid power sensor (W)
- Grid voltage sensor (V)
- Grid frequency sensor (Hz)
- Genertion power sensor (W)
- Generation power sensor (W)
- Charging/heating power sensor (W)
- Home power today sensor (W), power that is not charging, heating, generation and export
- Home power today sensor (W); consumption - power that is not charging, heating, generation and export
- Energy generated today sensor (kWh)
- Energy exported today sensor (kWh)
- Energy imported today sensor (kWh)
- Green energy today sensor (kWh), this is the amount of generated energy that was used for charging or heating instead of being exported
- Green energy today sensor (kWh); this is the amount of generated energy that was used for charging or heating instead of being exported

- Zappi

Expand All @@ -42,21 +42,29 @@ It will create HA devices depending on what you have installed:
- Power sensors for internal and external CT clamps (W)
- Plug status sensor
- Charger status sensor
- Minumum green level number input
- Minumum green level number input; how much power must be sourced from green sources (local generation) to do diversion charging
- Service to start boost (provide boost amount in kWh as parameter)
- Service to start smart boost (provide boost amount in kWh and desired finished time as paramters)

- Eddi

- Operating mode selector that let you switch between Stopped (no heating will take place) and Normal modes
- Power sensors for internal and external CT clamps (W)
- Temperature sensors if fitted
- service to start boost (provide boost amount in minutes as parameter)
- Service to start boost (provide boost amount in minutes as parameter)
- Heater priority; whether the first or second heater should be used first

- Harvi

- Power sensors for internal and external CT clamps (W)

Talking to the myenergi API using the [pymyenergi python library](https://github.com/cjne/pymyenergi)
Common sensor entities may also include:

- Serial number
- Firmware version
- Device priority; used for deciding which gets power first

This Home Assistant add-on talks to the myenergi API using the [pymyenergi python library](https://github.com/cjne/pymyenergi).

**This component will set up the following platforms.**

Expand Down Expand Up @@ -110,6 +118,8 @@ custom_components/myenergi/services.yaml
If you have trouble logging in you might need to request an API key from myenergi. You can generate one at your [myenergi account page](https://myaccount.myenergi.com).
See the [myenergi support article](https://support.myenergi.com/hc/en-gb/articles/5069627351185-How-do-I-get-an-API-key-) for more information.

If you need to change your API key for any reason, you will need to remove the device from "Integration entries", and re-add it again with the new API key. Historical data will not be lost.

<!---->

## Contributions are welcome!
Expand Down
2 changes: 1 addition & 1 deletion custom_components/myenergi/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
VERSION = "0.0.23"

ATTRIBUTION = "Data provided by myenergi"
ISSUE_URL = "https://github.com/cjne/myenergi/issues"
ISSUE_URL = "https://github.com/CJNE/ha-myenergi/issues"

# Icons
ICON = "mdi:format-quote-close"
Expand Down
38 changes: 30 additions & 8 deletions custom_components/myenergi/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,6 @@ async def async_setup_entry(hass, entry, async_add_devices):

# Sensors common to Zapi and Eddi
if device.kind in [ZAPPI, EDDI]:
sensors.append(
MyenergiSensor(
coordinator,
device,
entry,
create_meta("Status", "status", None, None, None, "mdi:ev-station"),
)
)
sensors.append(
MyenergiSensor(
coordinator,
Expand Down Expand Up @@ -352,6 +344,14 @@ async def async_setup_entry(hass, entry, async_add_devices):
)
# Zappi only sensors
if device.kind == ZAPPI:
sensors.append(
MyenergiSensor(
coordinator,
device,
entry,
create_meta("Status", "status", None, None, None, "mdi:ev-station"),
)
)
sensors.append(
MyenergiSensor(
coordinator,
Expand Down Expand Up @@ -425,6 +425,14 @@ async def async_setup_entry(hass, entry, async_add_devices):
)
elif device.kind == EDDI:
# Eddi specifc sensors
sensors.append(
MyenergiSensor(
coordinator,
device,
entry,
create_meta("Status", "status", None, None, None, "mdi:shower"),
)
)
sensors.append(
MyenergiSensor(
coordinator,
Expand All @@ -433,6 +441,20 @@ async def async_setup_entry(hass, entry, async_add_devices):
create_energy_meta("Energy consumed session", "consumed_session"),
)
)
sensors.append(
MyenergiSensor(
coordinator,
device,
entry,
create_meta("Active Heater",
"active_heater",
None,
None,
None,
"mdi:fraction-one-half",
),
)
)
if device.temp_1 != -1:
sensors.append(
MyenergiSensor(
Expand Down
8 changes: 4 additions & 4 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pre-commit==3.2.2
black==23.3.0
pre-commit==3.3.3
black==23.7.0
flake8==6.0.0
reorder-python-imports==3.9.0
reorder-python-imports==3.10.0
homeassistant
pymyenergi
pytest
pytest

0 comments on commit 0f6d728

Please sign in to comment.