Skip to content

IPEM Integration with Domoticz

Dave Williams | DitroniX | G8PUO edited this page Mar 27, 2023 · 4 revisions

IPEM ‘IPEM_1_Test_Code_ATM90E32_ATM90E36’ contains a number of options, some of which will configure the code to publish directly to Domoticz.

Assuming you have already calibrated the IPEM board, or taken the defaults for voltage and current settings, this wiki page allow you to easily setup for publishing to Domoticz, based on the ATM90E32.

A list of the various options can be found in Wiki


Quick Setup

file : \include\Domoticz.h

  • Const ssid
    • network SSID - Case Sensitive
  • Const password
    • WiFi Network password - Case Sensitive
  • Const domoticz_server
    • Domoticz Server IP Address (Typically a Fixed Local Address)
  • Variable port
    • Domoticz Network Port (Default)
  • Variable EnableDomoticz
    • Set to true
  • Domoticz Hardware Device Indexes
    • A number of variables, prefixed with 'idx', are used to enable(if > 0), or disable (if 0), publishing of the related data.
      • Default of these index variables is 0.
      • Device needs to be created in Domoticz.
      • example: int idxLineVoltage1 = 82; Will publish Line Voltage 1 to index 82.

Publish Frequency

Once the WiFI is configured and the Index setup, IPEM will continually publish index values every 1 second. This loop frequency can be easily changed in **\src\main.cpp **

Just change LoopDelay = 1, to whatever you need. Loop Delay in Seconds, i.e LoopDelay = 5 will be 5 seconds.


Example Settings

	int idxLineVoltage1 = 82;      // LineVoltage1 - Urms - Line 1 Voltage RMS
	int idxLineVoltage2 = 0;       // LineVoltage2 - Urms - Line 2 Voltage RMS
	int idxLineVoltage3 = 0;       // LineVoltage3 - Urms - Line 3 Voltage RMS
	int idxLineVoltageAverage = 0; // LineVoltageAverage - Urms - Line Average Voltage RMS (V1+V2+V3/3)
	int idxLineVoltageTotal = 0;   // LineVoltageTotal - Urms - Line Voltage Total RMS (V1+0+V3)

	int idxLineCurrentCT1 = 83;  // LineCurrentCT1 - Irms - Line 1 Current RMS
	int idxLineCurrentCT2 = 84;  // LineCurrentCT2 - Irms - Line 2 Current RMS
	int idxLineCurrentCT3 = 85;  // LineCurrentCT3 - Irms - Line 3 Current RMS
	int idxLineCurrentCT4 = 0;   // LineCurrentCT4 - Irms - Line 4 Current RMS (ESP)
	int idxLineCurrentCTN = 0;   // LineCurrentCTN - Irms - Line N Current RMS
	int idxLineCurrentTotal = 0; // LineCurrentTotal - Irms - Line Total Current RMS (CT1+CT2+CT3+(CT4))

	int idxCalculatedPowerCT1 = 86;  // Calculated Power V*A Watts RMS
	int idxCalculatedPowerCT2 = 87;  // Calculated Power V*A Watts RMS
	int idxCalculatedPowerCT3 = 88;  // Calculated Power V*A Watts RMS
	int idxCalculatedPowerCT4 = 0;   // Calculated Power V*A Watts RMS (ESP)
	int idxCalculatedTotalPower = 0; // CalculatedTotalPower

	int idxActivePowerCT1 = 89;  // ActivePowerCT1 - Pmean - Line Mean Active Power
	int idxActivePowerCT2 = 90;  // ActivePowerCT2 - Pmean - Line Mean Active Power
	int idxActivePowerCT3 = 91;  // ActivePowerCT3 - Pmean - Line Mean Active Power
	int idxTotalActivePower = 0; // TotalActivePower - Pmean - Line Mean Active Power

	int idxActivePowerImportCT1 = 92;  // ActivePowerCT1 - Pmean - Line Mean Active Power Import
	int idxActivePowerImportCT2 = 93;  // ActivePowerCT2 - Pmean - Line Mean Active Power Import
	int idxActivePowerImportCT3 = 94;  // ActivePowerCT3 - Pmean - Line Mean Active Power Import
	int idxTotalActivePowerImport = 0; // TotalActivePower - Pmean - Line Mean Active Power Import

Example Output

	Sending Message to Domoticz #82 245.54  	LineVoltage1
	Sending Message to Domoticz #83 0.67    	LineCurrentCT1
	Sending Message to Domoticz #84 0.64    	LineCurrentCT2
	Sending Message to Domoticz #85 0.65    	LineCurrentCT3
	Sending Message to Domoticz #86 164.51  	CalculatedPowerCT1
	Sending Message to Domoticz #87 157.41  	CalculatedPowerCT2
	Sending Message to Domoticz #88 159.52  	CalculatedPowerCT3
	Sending Message to Domoticz #89 163.49  	ActivePowerCT1
	Sending Message to Domoticz #90 157.81  	ActivePowerCT2
	Sending Message to Domoticz #91 -158.78     ActivePowerCT3
	Sending Message to Domoticz #92 163.49  	ActivePowerImportCT1
	Sending Message to Domoticz #93 157.81  	ActivePowerImportCT2
	Sending Message to Domoticz #94 0.00    	ActivePowerImportCT3
	Sending Message to Domoticz #95 0.00    	ActivePowerExportCT1
	Sending Message to Domoticz #96 0.00    	ActivePowerExportCT2
	Sending Message to Domoticz #97 158.78  	ActivePowerExportCT3

	15:18:10> Published to Domoticz

	Display Output Set to Minimised
	PCB Temperature Sensor (NTC_IN VN):     23.41 ºC
	ADC Raw: 2693 > ADC Adjusted: 2693 > Calculated: 25.65 V