Skip to content

Commit

Permalink
Merge pull request #632 from klaasnicolaas/release/v4.2.3
Browse files Browse the repository at this point in the history
Release v4.2.3
  • Loading branch information
klaasnicolaas authored Oct 24, 2024
2 parents 165e6f5 + 3cf355f commit f7bdd91
Show file tree
Hide file tree
Showing 26 changed files with 403 additions and 226 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
matrix: ${{ steps.prepare-matrix.outputs.matrix }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: ⤵️ Get changed files
if: github.event_name == 'pull_request'
id: changes
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
matrix: ${{fromJson(needs.prepare.outputs.matrix)}}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: 🔍 Determine ref - ESPHome packages
if: ${{ !contains(fromJSON('["release", "workflow_call"]'), github.event_name) }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
needs: combined-manifests
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: ⬇️ Download all artifacts
uses: actions/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
pull-requests: write
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: 🚀 Run Label Syncer
uses: micnncim/[email protected]
env:
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2024-01-11-fresh-new-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TL;DR - A lot 😅 ... v4.0.0 has been released, the most important changes are
1. The pulse meter pin for ESP32 boards has been changed from GPIO `13` to GPIO `26`.
2. The `home_assistant_glow.yaml` file no longer exists.

This would break the **package_import** for existing configs for people in the ESPHome dashboard. If you would like to use the latest version, I recommend re-flashing your ESP according to step 2 in [Getting Started](/docs/getting-started#step-2-install-firmware), and if desired, [re-adopting](/docs/advanced/firmware_customization#adopting-the-device) your device again in ESPHome dashboard (add-on).
This would break the **package_import** for existing configs for people in the ESPHome dashboard. If you would like to use the latest version, I recommend re-flashing your ESP according to step 2 in [Getting Started](/docs/getting-started#step-2-install-firmware), and if desired, [re-adopting](/docs/advanced/firmware_changes#adopting-the-device) your device again in ESPHome dashboard (add-on).

### New config structure

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2024-09-06-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If you would like to support the project, you can do so through [GitHub sponsors
- [ESPHome 2024.8.x - Changelog][esphome-changelog]
- [ESPHome - Extend][!extend]
- [Customizing the firmware](/docs/advanced/firmware_customization)
- [Customizing the Firmware](/docs/advanced/firmware_changes)
<!-- Links -->
[esphome-changelog]: https://esphome.io/changelog/2024.8.0.html
Expand Down
75 changes: 75 additions & 0 deletions docs/docs/advanced/firmware_changes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
id: firmware_changes
title: Customizing the Firmware
description: Learn how to customize the firmware of the Glow using ESPHome.
---

# Customizing the Firmware

The Glow's firmware is built on [ESPHome](https://esphome.io), a platform designed for customization through simple YAML configurations. Whether you need to tweak the device's functionality or adapt it for different use cases, the process is straightforward.

This guide will walk you through how to adopt the device and customize its firmware using the [ESPHome Dashboard](https://esphome.io/guides/getting_started_hassio.html).

## Adopting the Device

Before making any changes to the firmware, you first need to adopt the device into the ESPHome. Once your ESPHome Dashboard is up and running, and the Glow is connected to your local network, you should see an option to adopt it.

<p align="left">
<img src={require('@site/static/img/customization/adopt-esphome.png').default} />
</p>

Following the adoption steps will automatically:

1. Create a unique ESPHome configuration file for your device.
2. Set up a secure API encryption key, allowing communication between Home Assistant and your device.
3. Configure the device's network settings, such as Wi-Fi credentials.
4. Upload the customized firmware onto the Glow.

## Component Structure

The firmware is designed to be flexible for different ESP boards by breaking it into separate "components". Each main function of the device is kept in its own YAML file, making it easier to manage. The base configuration includes a few key components that handle the important functions of the device.

| Component | Description |
| :-------------------------------------------- | :---------------------------------------------------------------------------------------------------- |
| [**basis.yaml**][component-basis] | Handles the basic, essential functionality of the device. |
| [**pulse_meter.yaml**][component-pulse_meter] | Manages pulse metering, useful for tracking energy usage. |
| [**status_led.yaml**][component-status_led] | Controls the status LED, allowing customization of its behavior or color based on the device's state. |
| [**updates.yaml**][component-updates] | Provides Over-the-Air ([OTA][ota]) update capabilities for easy firmware updates. |

### Making Your First Customization

Once your device is adopted, you can start customizing its behavior by editing the configuration files. In the ESPHome dashboard, click on **EDIT** next to the device to open the YAML editor, where you can modify the configuration directly.

<p align="left">
<img src={require('@site/static/img/customization/edit-device.png').default} />
</p>

The YAML configuration may seem short and incomplete because it relies on [remote packages][remote], which are loaded during the firmware build process. If you want to customize or modify anything, it's important to first find the used ESPHome component ID.

When you open the YAML editor, you'll see the default configuration for your Glow device. You can adjust this configuration or add new functionality by extending the existing components. For example, to change the behavior of the [pulse_meter], you can use the [!extend] feature to easily make the necessary changes.

Here's an example of adding an [internal_filter] to the pulse meter configuration:

```yaml title="your_glow_config.yaml"
sensor:
- id: !extend sensor_energy_pulse_meter
internal_filter: 100ms
```
## Helpful Resources
- [ESPHome - Pulse Counter][pulse_meter]
- [ESPHome - Extend][!extend]
- [ESPHome - OTA Updates][ota]
- [ESPHome - Remote Packages][remote]
[internal_filter]: https://esphome.io/components/sensor/pulse_counter.html?highlight=internal_filter
[pulse_meter]: https://esphome.io/components/sensor/pulse_counter.html
[!extend]: https://esphome.io/components/packages.html#extend
[ota]: https://esphome.io/components/ota/
[remote]: https://esphome.io/components/packages.html#remote-git-packages
[component-basis]: https://github.com/klaasnicolaas/home-assistant-glow/blob/main/components/basis.yaml
[component-pulse_meter]: https://github.com/klaasnicolaas/home-assistant-glow/blob/main/components/pulse_meter.yaml
[component-status_led]: https://github.com/klaasnicolaas/home-assistant-glow/blob/main/components/status_led.yaml
[component-updates]: https://github.com/klaasnicolaas/home-assistant-glow/blob/main/components/updates.yaml
76 changes: 0 additions & 76 deletions docs/docs/advanced/firmware_customization.mdx

This file was deleted.

70 changes: 70 additions & 0 deletions docs/docs/advanced/firmware_updates.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
id: firmware_updates
title: Firmware Updates
description: Learn how to update the firmware of the Glow.
---

# Firmware Updates

Keeping your device's firmware up to date is essential to ensure it runs smoothly and benefits from the latest (ESPHome) features. This guide will walk you through how to update the firmware of the Home Assistant Glow.

## Updating Firmware through Home Assistant

_Level of Difficulty: **Easy**_

The easiest way to update the firmware of the Glow is through Home Assistant. When a new firmware update is available, you will receive a notification directly within Home Assistant. To update your device, follow these simple steps:

1. Look on the **Settings** page of Home Assistant for update notifications.
2. Click on the notification for the Home Assistant Glow.
3. A pop-up will appear with release notes / version number and the option to update the firmware.
4. Click **Install** to start the process.

<p align="left">
<img
width="80%"
src={require('@site/static/img/advanced/glow_update-popup.png').default}
alt="Update notification in Home Assistant"
/>
</p>

:::note
Since ESPHome 2024.6.x, the update component can directly retrieve firmware updates from the glow energy manifest. Which has made updating even easier and eliminates the need to use ESPHome Dashboard add-on just for updates.
:::

## Glow Web Interface

_Level of Difficulty: **Medium**_

If you are unable to update the firmware through Home Assistant, you can also update the firmware directly within the Glow's web interface. This method is useful if you are using the Glow as a standalone device or if you prefer to update the firmware manually.

1. Download the latest firmware binary file for your device:
- Download for ESP32: [home-assistant-glow-esp32.ota.bin](https://glow-energy.io/home-assistant-glow/esp32/home-assistant-glow-esp32.ota.bin)
- Download for ESP8266: [home-assistant-glow-esp8266.ota.bin](https://glow-energy.io/home-assistant-glow/esp8266/home-assistant-glow-esp8266.ota.bin)
2. Navigate to the Glow's web interface, by entering the IP address of the device in your browser.
3. At the bottom of the page, you will find the **OTA Update** section.
4. Click on **Choose File** and select the firmware binary file you downloaded.
5. Click **Upload** to start the update process.

After the update is complete, the device will automatically reboot with the new firmware.

## ESPHome Dashboard

_Level of Difficulty: **Advanced**_

If you are using the ESPHome Dashboard add-on in Home Assistant, you can also update the firmware through the dashboard. This method is useful if you have adopted the firmware to your ESPHome dashboard and know how to tweak the YAML configuration.

1. Open the ESPHome Dashboard.
2. If it is possible to update the firmware, you will see an update button at the device card (see image below).
3. Click on the **UPDATE** button to start the process.
4. Select **Wirelessly** to update the firmware over-the-air (OTA).
5. It will start the update process, and you will see the update process in a pop-up window.

Once the update is complete, the device will automatically reboot with the new firmware.

<p align="left">
<img
width="80%"
src={require('@site/static/img/advanced/glow_update-esphome.png').default}
alt="Update firmware through ESPHome Dashboard"
/>
</p>
44 changes: 0 additions & 44 deletions docs/docs/configuration.mdx

This file was deleted.

37 changes: 37 additions & 0 deletions docs/docs/configuration/energy_dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
id: energy_dashboard
title: Energy Dashboard
description: Learn how to set up an energy dashboard in Home Assistant to monitor your energy usage.
---

# Add to Energy Dashboard

To monitor your energy usage, you can add the Home Assistant Glow to the [Energy Dashboard][energy]. This dashboard provides an overview of your energy consumption, costs, and trends over time.

## Which entities to add?

You can choose between the following entities to add to the Energy Dashboard:

- **sensor.home_assistant_glow_daily_energy**
- **sensor.home_assistant_glow_total_energy**

It doesn't matter if the entity resets during the day for example due to an update/or hard reset after reboot. The long-term statistics in Home Assistant can handle that.

## Step-by-step guide to add entities

1. Open your Home Assistant dashboard/interface.
2. From the sidebar, click on **Energy**.
3. Click on the 3 dots in the top right corner and select **Energy Configuration**.
4. Click on **Add Consumption** and select the entity you want to add.
5. Optionally, you can setup the cost of your energy provider to get an overview of your energy costs.
6. Click **Save** to apply the changes.

:::note
If your Glow has just been added to Home Assistant, you may need to wait up to 2 hours before enough long-term statistics are stored to show in the Energy Dashboard.
:::

## Helpful resources

- [Home Assistant - Energy Management][energy]

[energy]: https://www.home-assistant.io/docs/energy
Loading

0 comments on commit f7bdd91

Please sign in to comment.