Skip to content

FlorianCasse/DuepiRemoteHA

Repository files navigation

DuepiRemoteHA

Duepi pellet stove icon

Control a Duepi pellet stove from Home Assistant via the dpremoteiot.com cloud API.

Features

  • Native Climate entity — full HVAC control with temperature and power level, using the stove's built-in temperature sensor
  • Auto-login — authenticates with email/password, auto-renews the session when it expires (no more manual cookie extraction!)
  • Automatic stove discovery — sign in and select a stove without hunting for its device ID
  • Config flow UI — set up entirely from the Home Assistant UI (Settings → Add Integration)
  • Eco and Comfort presets — switch temperature and power together from the climate entity
  • Rich diagnostics — alarms, problem state, last-seen time, operating hours, and estimated pellet use
  • HACS compatible — install easily via HACS custom repository
  • Reauth flow — automatically prompts for new credentials if authentication fails
  • Diagnostics — built-in diagnostic dump for troubleshooting

Prerequisites

Installation

Via HACS (recommended)

HACS (Home Assistant Community Store) is the easiest way to install custom integrations.

Don't have HACS yet? Follow the official HACS installation guide first.

  1. In Home Assistant, go to HACS → Integrations.
  2. Click the (3-dot menu) in the top-right corner → Custom repositories.
  3. In the dialog that opens:
    • Repository: https://github.com/FlorianCasse/DuepiRemoteHA
    • Category: select Integration
    • Click Add.
  4. Close the dialog. Search for Duepi Pellet Stove in the HACS integration list.
  5. Click Download and confirm.
  6. Restart Home Assistant (Settings → System → Restart).

Manual installation

Use this method if you don't want to use HACS.

  1. Download or clone this repository.
  2. Copy the entire custom_components/duepi/ folder into your Home Assistant configuration directory:
    <your HA config>/
    └── custom_components/
        └── duepi/
            ├── __init__.py
            ├── manifest.json
            ├── api.py
            ├── climate.py
            ├── ...
    

    Tip: The HA config directory is /homeassistant/ on Home Assistant OS 17+, /config/ on older HA OS/Supervised, or ~/.homeassistant/ for Core installations.

  3. Restart Home Assistant (Settings → System → Restart).

Setup

Once the integration is installed and HA has restarted:

Step 1 — Add the integration

  1. Go to Settings → Devices & Services.
  2. Click + Add Integration (bottom-right).
  3. Search for Duepi Pellet Stove and select it.
  4. Enter your dpremoteiot.com email and password.
  5. Select the stove discovered on your account. Selection is shown even when the account contains only one stove.
  6. Click Submit. A new Duepi Pellet Stove device appears with all its entities.

If the dashboard format prevents automatic discovery, the flow falls back to a manual Device ID field. Existing installations keep their current device ID and do not need to be reconfigured.

Authentication failed? Double-check your email and password. Make sure you can log in to dpremoteiot.com with the same credentials in a browser.

Step 2 — Configure options (optional)

  1. Go to Settings → Devices & Services → Duepi Pellet Stove.
  2. Click Configure.
Option Default Description
Update interval 30s How often to poll the stove state (min: 30s)
Comfort/default power 5 Power level used for Comfort and normal turn-on (1-5)
Comfort/default temperature 25°C Temperature used for Comfort and normal turn-on (5-40°C)
Eco power 1 Power level used by the Eco preset (1-5)
Eco temperature 18°C Temperature used by the Eco preset (5-40°C)
Pellet rate at power 1 0.6 kg/h Estimated minimum consumption rate (0-10 kg/h)
Pellet rate at power 5 1.8 kg/h Estimated maximum consumption rate (0-10 kg/h)

The minimum pellet rate must not exceed the maximum. Changing any option reloads the integration automatically.

Entities

All entities are grouped under a single Duepi Pellet Stove device:

Entity Type Description
Duepi Pellet Stove Climate Main control — HVAC mode, target temperature, power 1-5, and Eco/Comfort presets
Room temperature Sensor Current room temperature from the stove's built-in sensor (°C)
Power level Sensor Current working power level (1-5)
Status Sensor Status text (Heating, Idle, Standby, Off...)
Set temperature Sensor Current target temperature (°C)
Online Binary sensor Whether the stove is reachable via dpremoteiot.com
Problem Binary sensor Active when an alarm field or alarm/error status is reported
Alarm Sensor Cloud alarm text/code, disabled by default because fields vary by stove
Last seen Sensor Last UTC time the cloud explicitly reported the stove online
Operating hours Sensor Restored cumulative time while the stove is on
Pellet consumption (estimated) Sensor Restored consumption estimate based on runtime and power, disabled by default
Power level Number Slider to adjust power level (1-5)

The cloud can briefly report a healthy stove offline during its periodic heartbeat. The integration waits 120 seconds before publishing a disconnect, while restoring connectivity immediately on the next online report.

Migration from Script-Based Setup

If you were using the previous stoveOnOff.py + command_line setup, an interactive migration script is provided to guide you through the process.

Migration script

The script can run locally on your HA instance or remotely from your computer via SSH.

Local execution

If you have direct access to the HA terminal (SSH add-on, console, etc.):

python3 /config/scripts/migrate.py

Remote execution via SSH

Run the script from your computer — it connects to HA via SSH and performs all operations remotely:

# Basic usage (default SSH port 22):
python3 migrate.py --ssh root@homeassistant

# With a custom SSH port (e.g. Home Assistant OS uses port 22222):
python3 migrate.py --ssh root@192.168.1.100 --port 22222

# With a specific SSH key:
python3 migrate.py --ssh root@homeassistant --key ~/.ssh/ha_key

# Non-interactive mode (auto-confirm backup/removal, useful for scripting):
python3 migrate.py --ssh root@homeassistant --no-interactive

# Custom HA config directory (default is /config):
python3 migrate.py --ssh root@homeassistant --config /home/homeassistant/.homeassistant

# Rollback — restore old files and remove the custom integration:
python3 migrate.py --rollback
python3 migrate.py --rollback --ssh root@homeassistant

Script options

Option Default Description
--ssh USER@HOST (local) SSH destination for remote execution
--port PORT 22 SSH port (HA OS typically uses 22222)
--key PATH (none) Path to SSH private key file
--config PATH /config HA config directory on the target machine
--rollback (off) Restore old files from backup and remove the custom integration
--no-interactive (off) Skip confirmation prompts (auto-yes)

What the script does

  1. Detects the old installation (stoveOnOff.py and .env in /config/scripts/)
  2. Reads your old .env to extract the Device ID and default settings
  3. Scans configuration.yaml for command_line and generic_thermostat entries to remove
  4. Checks if the new custom_components/duepi integration is already installed
  5. Backs up old files to /config/duepi_migration_backup/ then removes them
  6. Prints step-by-step instructions to finish the migration in the HA UI

Example output

============================================================
  Duepi Pellet Stove — Migration Script
============================================================
  Mode: SSH remote → root@192.168.1.100
  HA config: /config

[Step 1] Detecting old installation
  ✓ Found old script: /config/scripts/stoveOnOff.py
  ✓ Found old .env: /config/scripts/.env

[Step 2] Reading old credentials
  ✓ Device ID: a1b2c3d4e5f6...
  ✓ Session cookie found (will NOT be migrated — new integration uses email/password)
  ✓ Default power: 5
  ✓ Default temperature: 25°C

[Step 3] Scanning configuration.yaml for old entries
  ⚠ Found command_line references to stoveOnOff.py:
      command_on: "python3 /config/scripts/stoveOnOff.py on"
      command_off: "python3 /config/scripts/stoveOnOff.py off"
      command_state: "python3 /config/scripts/stoveOnOff.py status"
  ✓ No generic_thermostat stove entries found

[Step 4] Checking new custom integration
  ✓ New integration already installed at custom_components/duepi/

[Step 5] Backup and cleanup
  ✓ Backed up: /config/scripts/stoveOnOff.py → /config/duepi_migration_backup/
  ✓ Backed up: /config/scripts/.env → /config/duepi_migration_backup/
  ✓ Removed: /config/scripts/stoveOnOff.py
  ✓ Removed: /config/scripts/.env

[Step 6] Next steps
  ...

Rollback

If the new integration doesn't work as expected, you can rollback to the old script-based setup:

# Locally:
python3 migrate.py --rollback

# Or via SSH:
python3 migrate.py --rollback --ssh root@homeassistant

The rollback will:

  1. Restore stoveOnOff.py and .env from the backup to /config/scripts/
  2. Remove the custom_components/duepi/ integration
  3. Clean up the backup directory
  4. Print instructions to re-add old YAML configuration and restart HA

Note: The rollback only restores the script files. You will need to manually re-add the command_line and generic_thermostat entries to your configuration.yaml (see the legacy/ folder for reference configs).

Manual migration

If you prefer to migrate manually without the script:

  1. Install the custom integration (see Installation).
  2. Remove from your configuration.yaml:
    • The command_line switch and sensor entries referencing stoveOnOff.py
    • The generic_thermostat climate entry (if used)
  3. Restart Home Assistant.
  4. Add the integration via the UI with your dpremoteiot.com email and password.
  5. Delete /config/scripts/stoveOnOff.py and /config/scripts/.env.
  6. Update any automations using the entity mapping below.

Entity mapping (old → new)

Old entity New entity
switch.pellet_stove climate.duepi_pellet_stove
sensor.pellet_stove_info (room_temperature) sensor.duepi_pellet_stove_room_temperature
sensor.pellet_stove_info (working_power) sensor.duepi_pellet_stove_power_level
sensor.pellet_stove_info (status_text) sensor.duepi_pellet_stove_status
sensor.pellet_stove_info (online) binary_sensor.duepi_pellet_stove_online

The old script files are preserved in the legacy/ folder of this repository for reference.

Troubleshooting

To enable debug logs, add the following to your configuration.yaml:

logger:
  default: warning
  logs:
    custom_components.duepi: debug

Restart Home Assistant and view the logs:

  • From the HA OS terminal: docker logs homeassistant 2>&1 | grep -i duepi
  • From Studio Code Server / File Editor: open the home-assistant.log file

Note: The Settings → System → Logs page only shows warnings and errors. Debug/info logs are only visible in the full log file or via docker logs.

Known Limitations

  • Power level may be ignored on startup — some stove models always start at a fixed power level regardless of the settedPower value. This is a stove firmware limitation, not a bug in this integration.
  • Cloud dependency — requires internet connectivity (communicates via dpremoteiot.com, not locally).
  • HTML scraping fallback — state detection primarily uses JSON data embedded in the dashboard HTML, with regex parsing as a fallback. If dpremoteiot.com changes their layout, the integration may need updating.
  • Estimated pellet use — consumption is calculated from configured rates and observed power, not measured by the stove. Gaps are capped to avoid counting through long outages or restarts.

About

Use a Duepi stove with HA and dpremoteiot.com

Topics

Resources

License

Stars

1 star

Watchers

2 watching

Forks

Packages

 
 
 

Contributors

Languages