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.
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.
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)
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)
Go to Setup → Hardware, and add a new HTTP listener:
iammeter.lua
scriptiammetert.lua
📸 Screenshots (example):
After adding the hardware, click “Create Virtual Sensors”:
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:
Once configured, navigate to Utility to view the real-time data from your IAMMETER energy meter.
📊 Domoticz will continuously log and visualize this data for historical tracking and automation triggers.
Three Phase Wi-Fi Energy Meter (WEM3080T)
Single Phase Wi-Fi Energy Meter (WEM3080)
Three Phase Wi-Fi Energy Meter (WEM3046T)
Three Phase Wi-Fi Energy Meter (WEM3050T)