SmartHomeShop Docs

Usage Guide

This guide covers practical ways to use your P1MeterKit in Home Assistant, including Energy Dashboard setup, automation examples, and dashboard tips.

Quick Start

After installation, your P1MeterKit provides these key entities:

Energy Entities

Entity Use For
Energy Consumed Tariff 1 Low tariff consumption, use for Energy Dashboard
Energy Consumed Tariff 2 High tariff consumption, use for Energy Dashboard
Energy Produced Tariff 1 Solar feed-back low tariff, use for Energy Dashboard
Energy Produced Tariff 2 Solar feed-back high tariff, use for Energy Dashboard
Power Consumed Current power usage (W)
Power Produced Current solar production (W)
Electricity Tariff Current active tariff (0001 or 0002)

Gas Entity

Entity Use For
Gas Consumed Total gas consumption, use for Energy Dashboard

Home Assistant Energy Dashboard

The Energy Dashboard gives you beautiful visualizations of your energy consumption and production.

Adding Electricity Consumption

  1. Go to Settings → Dashboards → Energy
  2. Under Electricity grid, click Add grid connection
  3. Select Energy Consumed Tariff 1 (low tariff) as Energy imported from grid and click Save
  4. Add a second grid connection with Energy Consumed Tariff 2 (high tariff)

Adding Solar Production

If you have solar panels:

  1. Open the grid connection of tariff 1 and select Energy Produced Tariff 1 as Energy exported to grid
  2. Do the same in the grid connection of tariff 2 with Energy Produced Tariff 2
  3. Click Save

Adding Gas Consumption

  1. Under Gas Consumption, click Add Gas Source
  2. Select Gas Consumed entity
  3. Click Save

After ~5 minutes, your data will appear in the Energy Dashboard!


Automation Examples

Before you copy: the examples use sensor.p1meterkit_.... Your kit adds its MAC suffix to the name, so the real ID looks like sensor.p1meterkit_a1b2c3_power_consumed. Look up your own IDs under Settings → Devices & Services → Entities. Also replace notify.mobile_app with your own notify service, such as notify.mobile_app_your_phone.

1. High Power Usage Alert

Alert when power consumption is unusually high:

alias: "Energy - High power alert"
trigger:
  - platform: numeric_state
    entity_id: sensor.p1meterkit_power_consumed
    above: 5000  # More than 5kW
    for:
      minutes: 5
action:
  - service: notify.mobile_app
    data:
      title: "⚡ High Power Usage"
      message: "Current power: {{ states('sensor.p1meterkit_power_consumed') }}W"

2. Solar Production Notification

Get notified when your solar panels are producing well:

alias: "Solar - Good production alert"
trigger:
  - platform: numeric_state
    entity_id: sensor.p1meterkit_power_produced
    above: 3000  # More than 3kW production
condition:
  - condition: time
    after: "10:00:00"
    before: "16:00:00"
action:
  - service: notify.mobile_app
    data:
      title: "☀️ Solar Power!"
      message: "Producing {{ states('sensor.p1meterkit_power_produced') }}W - great solar day!"

3. Low Tariff Appliance Notification

Remind to run appliances during low tariff:

alias: "Energy - Low tariff started"
trigger:
  - platform: state
    entity_id: sensor.p1meterkit_electricity_tariff
    to: "0001"  # Low tariff (on Belgian meters: "0002")
action:
  - service: notify.mobile_app
    data:
      title: "💰 Low Tariff Started"
      message: "Good time to run dishwasher, washing machine, or charge EV!"

4. Power Failure Alert

Get notified of power failures:

alias: "Energy - Power failure detected"
trigger:
  - platform: state
    entity_id: sensor.p1meterkit_electricity_failures
action:
  - service: notify.mobile_app
    data:
      title: "⚠️ Power Failure Detected"
      message: "Total failures recorded: {{ states('sensor.p1meterkit_electricity_failures') }}"

5. Solar-Based Boiler Control

Turn on boiler when solar production is high:

alias: "Boiler - Solar-based control"
trigger:
  - platform: state
    entity_id: sensor.p1meterkit_power_produced
action:
  - choose:
      # High solar production - turn on boiler
      - conditions:
          - condition: numeric_state
            entity_id: sensor.p1meterkit_power_produced
            above: 2000
        sequence:
          - service: switch.turn_on
            target:
              entity_id: switch.boiler
      # Low solar production - turn off boiler
      - conditions:
          - condition: numeric_state
            entity_id: sensor.p1meterkit_power_produced
            below: 500
        sequence:
          - service: switch.turn_off
            target:
              entity_id: switch.boiler

6. Daily Energy Report

Send a notification with your daily energy usage:

alias: "Energy - Daily report"
trigger:
  - platform: time
    at: "21:00:00"
action:
  - service: notify.mobile_app
    data:
      title: "📊 Daily Energy Report"
      message: >
        Today's usage: {{ states('sensor.energy_daily') }} kWh
        Solar produced: {{ states('sensor.solar_daily') }} kWh

Note: You'll need to create utility meter helpers for daily tracking (see Dashboard section below).


Gas MBus Configuration

If your gas meter data is not showing in Home Assistant, the MBus ID might need to be changed.

How to Change the MBus ID

  1. Adopt the P1MeterKit in ESPHome

    • Go to Home Assistant → ESPHome Device Builder app
    • Click on your P1MeterKit device
    • Click Adopt if not already adopted
  2. Edit the configuration

    • Find the substitutions section at the top. Keep the lines that are already there
    • Add gas_mbus_id with the value "2", "3", or "4" (the default is "1"):
substitutions:
  name: p1meterkit-a1b2c3
  friendly_name: P1MeterKit A1B2C3
  gas_mbus_id: "2"  # Try 2, 3, or 4 if gas doesn't show
  1. Save and Install

    • Click Save then Install
    • Choose Wirelessly to update over-the-air
  2. Wait and Check

    • Gas data is updated hourly, so wait at least an hour
    • If still no data, try the next MBus ID

Why Different MBus IDs?

Your smart meter can have multiple devices connected via MBus. Each device has a unique ID (1-4). Most Dutch gas meters use ID 1, but Belgian and some other meters may use different IDs.


Older DSMR Meters & Regional P1 Settings

If your P1MeterKit powers on but electricity values remain N/A, unknown, or incomplete, the serial profile of the smart meter usually needs to be adjusted in ESPHome.

Step 1: Adopt the P1MeterKit in ESPHome

Before changing any YAML:

  1. Go to Home Assistant → ESPHome Device Builder app
  2. Click on your P1MeterKit device
  3. Click Adopt if it is not adopted yet
  4. Open the YAML editor for the device
  5. Save and install after each change you test

DSMR 2/3 Profile

After adopting the device in ESPHome, this is the first override we recommend testing on older DSMR 2 and DSMR 3 meters:

uart:
  id: uart_dsmr
  baud_rate: 9600
  data_bits: 7
  parity: EVEN
  stop_bits: 1

dsmr:
  id: dsmr_instance
  uart_id: uart_dsmr
  crc_check: false

DSMR 2.2 Alternative

ESPHome officially documents DSMR 2.2 support with this profile:

uart:
  id: uart_dsmr
  baud_rate: 9600
  data_bits: 7
  parity: NONE
  stop_bits: 1

dsmr:
  id: dsmr_instance
  uart_id: uart_dsmr
  crc_check: false

Regional Notes

  • Belgium: if gas stays empty, first enable the disabled Gas Consumed Belgium entity, then test gas_mbus_id values 1 through 4.
  • External power: older meters often need USB-C power because not every P1 port can power the kit reliably.
  • Decryption key: only configure decryption_key if your meter or utility explicitly uses encrypted telegrams and provides a 32-character key. ESPHome calls this out for encrypted setups such as Luxembourg Smarty, not as a default Belgian requirement.
dsmr:
  decryption_key: !secret dsmr_decryption_key

Dashboard Ideas

Creating Utility Meters

To track daily, weekly, and monthly consumption, create utility meter helpers:

  1. Go to Settings → Devices & Services → Helpers
  2. Click Create Helper → Utility Meter
  3. Configure:
    • Name: Energy Daily
    • Input sensor: sensor.p1meterkit_energy_consumed_tariff_1 (repeat for tariff 2)
    • Meter reset cycle: Daily
  4. Repeat for weekly and monthly

Recommended Dashboard Entities

Energy Monitoring:

  • sensor.p1meterkit_power_consumed: Current power usage
  • sensor.p1meterkit_power_produced: Solar production
  • sensor.p1meterkit_energy_consumed_tariff_1: Low tariff total
  • sensor.p1meterkit_energy_consumed_tariff_2: High tariff total

Gas Monitoring:

  • sensor.p1meterkit_gas_consumed: Total gas

Voltage Monitoring:

  • sensor.p1meterkit_voltage_phase_1: Voltage phase 1

Example Dashboard Card - Energy Overview

type: entities
title: ⚡ Energy
entities:
  - entity: sensor.p1meterkit_power_consumed
    name: Current Usage
  - entity: sensor.p1meterkit_power_produced
    name: Solar Production
  - entity: sensor.p1meterkit_electricity_tariff
    name: Active Tariff

Power Gauge Card

type: gauge
entity: sensor.p1meterkit_power_consumed
name: Current Power
min: 0
max: 10000
severity:
  green: 0
  yellow: 3000
  red: 6000
unit: W

History Graph - Daily Pattern

type: history-graph
title: Power Usage Today
entities:
  - entity: sensor.p1meterkit_power_consumed
  - entity: sensor.p1meterkit_power_produced
hours_to_show: 24

Best Practices

Power Requirements

  • DSMR v5 meters usually power the P1MeterKit via RJ12 cable
  • DSMR v4 meters require USB-C power
  • If LEDs flash rapidly, use USB-C power

Tariff Optimization

Use the Electricity Tariff entity to:

  • Run high-power appliances during low tariff (usually nights/weekends)
  • Charge EVs during cheap hours
  • Time dishwasher and washing machine cycles

Solar Optimization

Use Power Produced to:

  • Time high-consumption tasks when solar production is high
  • Control boiler or EV charging based on excess solar

ESPHome Configuration

For advanced users who want to customize the P1MeterKit firmware.

Adopting in ESPHome

  1. Go to Home Assistant → ESPHome Device Builder app
  2. Your P1MeterKit should appear. Click Adopt
  3. Once adopted, you can edit the YAML configuration

Key Substitutions

substitutions:
  device_name: p1meterkit
  friendly_name: P1MeterKit
  gas_mbus_id: "1"  # Change to 2, 3, or 4 if gas doesn't show

Using GitHub Packages

Import directly from GitHub:

packages:
  smarthomeshop.p1meterkit: 
    github://smarthomeshop/p1meterkit/p1meterkit-v3/p1meterkit.yaml@main

Use p1meterkit-v2 or p1meterkit-v1 in the path if you have older hardware.

Source Code


Common Use Cases

Scenario Key Entities Automation Ideas
Cost Tracking Energy Consumed Tariff 1/2 Calculate costs per tariff
Solar Optimization Power Produced Control boiler, EV charger
Appliance Detection Power Consumed Detect washing machine, dishwasher
Tariff Switching Electricity Tariff Notify when cheap tariff starts
Power Monitoring Voltage, Current Monitor electrical supply quality
Gas Tracking Gas Consumed Monthly gas usage reports

Integration Ideas

Combine with Other SmartHomeShop Products

Product Combined Use
WaterP1MeterKit Add water monitoring
CeilSense Correlate presence with energy usage
WaterMeterKit Separate water monitoring

Third-Party Integrations

  • Grafana: Detailed energy dashboards
  • InfluxDB: Long-term data storage
  • Node-RED: Complex automation flows
  • DSMR Reader (Docker): Forward raw P1 telegrams to a separate, self-hosted energy archive

Need Help?