-
Notifications
You must be signed in to change notification settings - Fork 3
IPEM Integration with MQTT
The IPEM IPEM_1_Test_Code_ATM90E32_ATM90E36 (230526 onwards), includes direct publishing of MQTT messages.
Example Messages
Examples of Available Variables
- LineVoltage1, LineVoltage2, LineVoltage3, LineVoltageTotal, LineVoltageAverage
- LineCurrentCT1, LineCurrentCT2, LineCurrentCT3, LineCurrentCT4, LineCurrentCTN, LineCurrentTotal
- CalculatedPowerCT1, CalculatedPowerCT2, CalculatedPowerCT3, CalculatedPowerCT4, CalculatedPowerCTN, CalculatedTotalPower
- ActivePowerCT1, ActivePowerCT2, ActivePowerCT3, TotalActivePower, CalculatedTotalActivePower
- ActivePowerImportCT1, ActivePowerImportCT2, ActivePowerImportCT3, TotalActivePowerImport
- ActivePowerExportCT1, ActivePowerExportCT2, ActivePowerExportCT3, TotalActivePowerExport
- ReactivePowerCT1, ReactivePowerCT2, ReactivePowerCT3, TotalReactivePower, CalculatedTotalReactivePower
- ApparentPowerCT1, ApparentPowerCT2, ApparentPowerCT3, TotalApparentPower, CalculatedTotalApparentPower
- TotalActiveFundPower, TotalActiveHarPower
- PowerFactorCT1, PowerFactorCT2, PowerFactorCT3, TotalPowerFactor
- PhaseAngleCT1, PhaseAngleCT2, PhaseAngleCT3
- ChipTemperature, LineFrequency
Value Formatting
PublishMQTTMessage(String SensorName, float SensorValue, int dPlaces = 1, int dWidth = 5, int dQOS = 0)
-
Default options are provided for dPlaces (typically 0,1,2 etc.), _dWidth _(typically 5), and **dQOS **(typically 0 or 1)
-
The sensor name forms part of the MQTT Topic. For example: ipem/'SensorName'
The MQTT Payload includes formatting options within the message, as highlighted above. This typically is the number of decimal places to display and publish.
`// Test Message Example.`
`PublishMQTTMessage("LineVoltage1", LineVoltage1);`
`PublishMQTTMessage("ActivePowerCT1", ActivePowerCT1, 0);`
`PublishMQTTMessage("ActivePowerCT2", ActivePowerCT2, 0);`
`PublishMQTTMessage("ActivePowerCT3", ActivePowerCT3, 0);`
`PublishMQTTMessage("LineFrequency", LineFrequency, 2);`
Enabling MQTT
Within MQTT.h, the below user options are provided:
// MQTT Server info. Setup with your MQTT Configration
const char *MQTTServer = "192.168.1.12"; // MQTT Server IP Address (Typically a Fixed Local Address)
int MQTTPort = 1883; // MQTT Network Port (Default 1883)
boolean EnableMQTT = true; // Change to true to enable read Loop and sending data to MQTT. Default false.
const char *MQTTUser = ""; // MQTT User - if applicable
const char *MQTTPassword = ""; // MQTT Password - if applicable
String MQTTTopicMain = "ipem"; // MQTT Default Topic. Exclude the trailing /
Additional information, and other technical details on this project, maybe found in the related repository pages.
Repository Folders
- Code (Code examples for Arduino IDE and PlatformIO)
- Datasheets and Information (Component Datasheets, Schematics, Board Layouts, Photos, Technical Documentation)
- Certification (Related Repository Project or Part, Certification Information)
Repository Tabs
- Wiki (Related Repository Wiki pages and Technical User Information)
- Discussions (Related Repository User Discussion Forum)
- Issues (Related Repository Technical Issues and Fixes)
We value our Customers, Users of our designs and STEM Communities, all over the World . Should you have any other questions, or feedback to share to others, please feel free to:
- Visit the related Project plus the related Discussions and Wiki Pages. See tab in each separate repository.
- Project Community Information can be found at https://www.hackster.io/DitroniX
- DitroniX.net Website - Contact Us
- Twitter: https://twitter.com/DitroniX
- Supporting the STEM Projects - BuyMeACoffee
- LinkedIN: https://www.linkedin.com/in/g8puo/
Dave Williams, Eastbourne, UK.
Electronics Engineer | Software Developer | R&D Support | RF Engineering | Product Certification and Testing | STEM Ambassador
Supporting STEM Learning
Life is one long exciting learning curve, help others by setting the seed to knowledge.