We help you choose the right device for your system Ask an expert →
← Back to the blog

Automation Rules — Help for HMKE.APP

▣ 2026-04-10 ◉ 1006 views
⚠️
Important Warning — Please read before you start!
Automation rules are an advanced feature that allows the ADA P1 Meter to independently control your home devices (e.g., boiler, switches, inverter).

If you’re unsure about the setup, please ask for help — we take no responsibility for any damage resulting from incorrect automation rules (e.g., device overload, unintended switching on or off).

We’re happy to assist! Contact us via customer support, and we will set up the rules together: info@greenhess.com

What is an automation rule?

Automation rules allow the ADA P1 Meter to act independently and automatically based on the data it measures — without human intervention.

The logic of the rules is simple: “IF something is true, THEN do something.” For example: “IF the instantaneous consumption is less than 0.5 kW, THEN turn ON the boiler.”

Rules run on the device (the ESP32 microcontroller) — no internet or cloud is needed for operation. Every time a DSMR data packet arrives, all active rules are evaluated.

Note: This feature is available with firmware version 2.0.0 or newer.

Structure of a rule

Each rule has a name, condition, timing, and at least one action:

Name (ID)

The rule identifier. Short and clear, e.g., “bojler_be”. Spaces are not allowed.

Condition (IF)

A mathematical expression that returns true or false. E.g.: import < 0.5

⏱️ Timing

How many seconds the condition must continuously hold (hold), and how often it can be repeated (cooldown).

⚡ Action (THEN)

One or more HTTP requests (e.g., Shelly or Inverter command) that run when the condition is met.

Conditions (IF)

The condition structure: variable_name operator value

Simple conditions
instantaneous_power_import > 2.5 // "If instantaneous import is more than 2.5 kW" time_hm > 1400 // "If the time is after 14:00" voltage_phase_l1 < 210 // "If the L1 voltage drops below 210V"
Complex conditions (AND / OR)

You can combine multiple conditions. && means AND (both true), || means OR (any true).

import > 1.5 && time_hm > 0600 // "Consumption > 1.5 kW AND it is after 6 AM" export > 1 || import < 0.1 // "Export > 1 kW OR consumption is nearly zero"

Available variables

You can use these variables in conditions (case sensitive):

time_hm
Current time in HHMM format (e.g., 0830, 1445).
instantaneous_power_import
Instantaneous power import from the grid in kW.
instantaneous_power_export
Instantaneous power export to the grid in kW.
voltage_phase_l1 / l2 / l3
Voltage per phase in volts (V).
current_phase_l1 / l2 / l3
Current per phase in amperes (A).
current_tariff
Current tariff code (e.g., 0001 or 0002).
frequency
Grid frequency in Hz (e.g., 50.0).
Plugin data: If you have Shelly or PZEM devices, their values are accessible as plugins.KEY.value.

Comparison operators

Operator Meaning Example True if...
>Greater thanimport > 2import more than 2 kW
<Less thanimport < 0.5import less than 0.5 kW
>=Greater or equaltime_hm >= 06006 AM or later
<=Less or equaltime_hm <= 220010 PM or earlier
==Exactly equaltariff == 1the tariff is exactly 1
!=Not equaltariff != 2the tariff is anything but 2
⚠️ Decimal numbers: Always use a decimal point, not a comma! (e.g., 1.5)

⏱️ Timing and repetition

⏳ Hold for (X seconds)

The condition must continuously be true for this duration before triggering. If it breaks, the timer resets.

Repeat

If enabled, the action can run repeatedly while the condition is true. If disabled, it runs only once.

⏰ Repeat cooldown

For repeated runs, the cooldown time between actions in seconds (e.g., 600 s = 10 minutes).

Example: Boiler when consumption is low for 5 minutes

Hold for: 300 (5 minutes)

It switches on only if the consumption stays low continuously for 5 minutes.

⚡ Actions (THEN)

An action is an HTTP request sent by ADA P1 to your local WiFi network.

http://192.168.1.50/relay/0?turn=on // Shelly switch ON http://192.168.1.51/cm?cmnd=Power%20On // Tasmota device ON
⚠️ Important: Actions only work reliably on the local network (same WiFi).

☀️ Inverter control

If an inverter is connected to the device, you can use the following commands to control feed-in:

Command template What does it do? When to use?
Inverter PRODAllows maximum productionIf no restrictions are needed
Inverter NOPRODDisable production (0%)If feed-in is forbidden (e.g., at night)
Inverter AUTOAutomatic P1 controlADA P1 itself maintains the limit
Inverter EMPTYBattery charging priorityIf you want to charge the battery first

Practical examples

✅ Example 1 — Boiler turns on during daytime

Condition: import < 0.3 && time_hm > 0800 && time_hm < 1700

Hold for: 120 (2 minutes)

If between 8 AM and 5 PM consumption is low for 2 minutes, the boiler turns on.

✅ Example 2 — Disable solar feed-in at night

Condition: time_hm >= 2200

Stops production at 10 PM.

✅ Example 3 — Reduce consumption during peak hours

Condition: import > 5 && time_hm >= 1700 && time_hm <= 2000

Turns off a large consumer if consumption exceeds 5 kW during peak hours.

Tips and common mistakes

⚠️ time_hm and midnight

Time runs from 0 to 2359. To bridge midnight (e.g., 23:00-01:00), you need two separate rules.

⚠️ JSON size limit

The total size of the rules can be max. 8192 bytes in device memory.

✅ Testing

Before putting the URL into a rule, try it in your browser. If it doesn’t work there, the rule won’t work either.

Unsure? Ask for help!
Customer support: info@greenhess.com | greenhess.com