Sorry, your browser does not support JavaScript!

Integrate with Domoticz

Integrate IAMMETER Wi-Fi Energy Meters into Domoticz for Smart Power Monitoring

Understanding your electricity usage is the first step to reducing unnecessary consumption and saving on your power bill. IAMMETER provides accurate Wi-Fi energy meters and open protocols to help users track and optimize their energy use. This guide demonstrates how to seamlessly integrate IAMMETER smart meters into Domoticz—an open-source home automation system—for real-time power monitoring and visualization.


1. Introduction to Domoticz + IAMMETER

Domoticz is a powerful open-source home automation system that supports lights, switches, and a wide variety of sensors—including energy meters. With support for Lua scripting and virtual sensors, it’s easy to connect devices like IAMMETER’s Wi-Fi energy meters (WEM3080 and WEM3080T) and track power usage in real time.


2. Configure Domoticz to Work with IAMMETER Energy Meters

Step 1: Add Lua Parsers for IAMMETER Meters

For Single-Phase Meter (WEM3080)

Create a new Lua script under /domoticz/scripts/lua_parsers/ Filename: iammeter.lua

lua复制编辑-- Retrieve the request content
s = request['content'];

-- Extract energy data from JSON
local voltage = domoticz_applyJsonPath(s, '.Data[0]')
local current = domoticz_applyJsonPath(s, '.Data[1]')
local power = domoticz_applyJsonPath(s, '.Data[2]')
local importenergy = domoticz_applyJsonPath(s, '.Data[3]')
local exportgrid = domoticz_applyJsonPath(s, '.Data[4]')

-- Update corresponding Domoticz devices
domoticz_updateDevice(1, 0, voltage)
domoticz_updateDevice(2, 0, current)
domoticz_updateDevice(3, 0, power)
domoticz_updateDevice(4, 0, importenergy)
domoticz_updateDevice(5, 0, exportgrid)

For Three-Phase Meter (WEM3080T)

Create iammetert.lua in the same folder:

lua复制编辑-- Retrieve the request content
s = request['content'];

-- Phase A
local voltage_a = domoticz_applyJsonPath(s, '.Datas[0][0]')
local current_a = domoticz_applyJsonPath(s, '.Datas[0][1]')
local power_a = domoticz_applyJsonPath(s, '.Datas[0][2]')
local importenergy_a = domoticz_applyJsonPath(s, '.Datas[0][3]')
local exportgrid_a = domoticz_applyJsonPath(s, '.Datas[0][4]')

-- Phase B
local voltage_b = domoticz_applyJsonPath(s, '.Datas[1][0]')
local current_b = domoticz_applyJsonPath(s, '.Datas[1][1]')
local power_b = domoticz_applyJsonPath(s, '.Datas[1][2]')
local importenergy_b = domoticz_applyJsonPath(s, '.Datas[1][3]')
local exportgrid_b = domoticz_applyJsonPath(s, '.Datas[1][4]')

-- Phase C
local voltage_c = domoticz_applyJsonPath(s, '.Datas[2][0]')
local current_c = domoticz_applyJsonPath(s, '.Datas[2][1]')
local power_c = domoticz_applyJsonPath(s, '.Datas[2][2]')
local importenergy_c = domoticz_applyJsonPath(s, '.Datas[2][3]')
local exportgrid_c = domoticz_applyJsonPath(s, '.Datas[2][4]')

-- Update all phase devices
domoticz_updateDevice(6, 0, voltage_a)
domoticz_updateDevice(7, 0, current_a)
domoticz_updateDevice(8, 0, power_a)
domoticz_updateDevice(9, 0, importenergy_a)
domoticz_updateDevice(10, 0, exportgrid_a)

domoticz_updateDevice(11, 0, voltage_b)
domoticz_updateDevice(12, 0, current_b)
domoticz_updateDevice(13, 0, power_b)
domoticz_updateDevice(14, 0, importenergy_b)
domoticz_updateDevice(15, 0, exportgrid_b)

domoticz_updateDevice(16, 0, voltage_c)
domoticz_updateDevice(17, 0, current_c)
domoticz_updateDevice(18, 0, power_c)
domoticz_updateDevice(19, 0, importenergy_c)
domoticz_updateDevice(20, 0, exportgrid_c)

Step 2: Add IAMMETER as Hardware in Domoticz

Go to Setup → Hardware, and add a new HTTP listener:

  • Set parameters as shown in the screenshots below
  • For WEM3080 (single-phase), select the iammeter.lua script
  • For WEM3080T (three-phase), select iammetert.lua

📸 Screenshots (example):

Add hardware Add for WEM3080T


Step 3: Create Virtual Sensors for Data Mapping

After adding the hardware, click “Create Virtual Sensors”:

  • For WEM3080: Create 5 virtual sensors (Voltage, Current, Power, Import, Export)
  • For WEM3080T: Create 15 virtual sensors (5 metrics × 3 phases)

Create virtual sensors


Step 4: Assign Correct Device Index (IDX)

Make sure the IDX numbers in the Lua script match the virtual sensor IDs in Domoticz.

📌 Example:

lua


复制编辑
domoticz_updateDevice(1, 0, voltage) → IDX = 1

Check Setup → Devices to verify the sensor indexes:

IDX match


3. Visualize Energy Data in Domoticz

Once configured, navigate to Utility to view the real-time data from your IAMMETER energy meter.

  • Power usage (W)
  • Voltage (V)
  • Current (A)
  • Imported & exported energy (kWh)

📊 Domoticz will continuously log and visualize this data for historical tracking and automation triggers.

Domoticz Utility View


Why Use IAMMETER with Domoticz?

  • ✅ Full local integration, no cloud required
  • 📶 Real-time power monitoring over Wi-Fi
  • 🧰 Support for single-phase and three-phase meters
  • 🔧 Easy scripting via Lua parser
  • 🌞 Perfect for solar PV, smart home, and energy cost optimization

Top