Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/dot-github/workflows/pip-23.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
CJNE authored Sep 12, 2023
2 parents bc0a7c6 + 0672933 commit 52c2607
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pip==23.1.2
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
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3.5.0
uses: actions/checkout@v3.5.3

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v4.1.0
Expand Down
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 }}
12 changes: 6 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
name: Pre-commit
steps:
- name: Check out the repository
uses: actions/checkout@v3.5.0
uses: actions/checkout@v3.5.3

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.5.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}

Expand All @@ -44,7 +44,7 @@ jobs:
name: HACS
steps:
- name: Check out the repository
uses: "actions/checkout@v3.5.0"
uses: "actions/checkout@v3.5.3"

- name: HACS validation
uses: "hacs/action@22.5.0"
Expand All @@ -57,7 +57,7 @@ jobs:
name: Hassfest
steps:
- name: Check out the repository
uses: "actions/checkout@v3.5.0"
uses: "actions/checkout@v3.5.3"

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
Expand All @@ -66,9 +66,9 @@ jobs:
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v3.5.0"
uses: "actions/checkout@v3.5.3"
- name: Setup Python ${{ env.DEFAULT_PYTHON }}
uses: "actions/setup-python@v4.5.0"
uses: "actions/setup-python@v4.6.1"
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
Expand Down
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 52c2607

Please sign in to comment.