# Applicable hardware: PG-R101 and PG-R102 with the required driver license and fitted interfaces. Examples use E0/P0; P1 is PG-R101 only where fitted. # MQTT client detailed sample configuration # # This file is both a readable reference and a valid MQTT client config. # # General notes: # - Adapter can be E0, E1, W0, or W1 depending on the product hardware. # W0 is Wi-Fi. W1 is cellular data through the cellular interface. # - Function can be pub/publish or sub/subscribe. # - Data_Type can be JSON or String. # - QOS can be 0, 1, or 2. # - Publish_Interval_Sec can be: # - a number, for periodic publishing every N seconds # - -, for COV publishing only when the source point changes # - Special Files are referenced by file name only. Use uploaded filenames only. # - For plain MQTT without TLS, set SSL_TLS and all file fields to - or disable as shown below. # # JSON address notes: # - Address paths use [str:name] for JSON object keys and [int:0] for array indexes. # - Nested JSON example: [str:meters;int:0;str:voltage] # - String payload points do not need a JSON address, so use -. # # mqtt_json_template notes: # - The template Address is a complete JSON payload template. # - Use semicolons instead of commas inside the template because this config is CSV. # - These template keywords must be used without quotes: # - pid_100 inserts the current value of point ID 100 # - tsdatetime inserts the current date/time string # - tsmillis inserts the current timestamp in milliseconds # - Example: {"value":pid_100;"time_ms":tsmillis} # - If you write "tsmillis" with quotes, it is treated as the literal text tsmillis. # - Static text values must still be quoted, for example "device":"PG-R101". # - For subscribe nodes, mqtt_json_template works in reverse: # - if the incoming JSON has the configured key path, pid_x points are updated from those values # - missing keys are ignored # - extra keys in the incoming JSON are ignored # - nested dictionaries and lists are supported Connections Connection_Name , Adapter , Protocol , Driver_Type , IP_Port , Host_IP_Or_URL , KeepAlive_Sec , SSL_TLS , Client_Id , User_Name , Password , Use_ClientCertificate , CA_File , Client_Cert_File , Client_Key_File MQTTConnection , E0 , MQTT , Client , 1883 , broker.example.com , 60 , disable , ProtoConvert , - , - , - , - , - , - Nodes Node_Name , Connection_Name , Node_Id , Topic , Function , QOS , Publish_Interval_Sec , Data_Type # Periodic JSON publish every 10 seconds. JsonPeriodicPublish , MQTTConnection , 1 , protocon/example/json/pub , pub , 0 , 10 , JSON # JSON subscribe. Incoming payload is expected to contain the addresses configured in Points_List. JsonSubscribe , MQTTConnection , 2 , protocon/example/json/sub , sub , 0 , - , JSON # Periodic String publish every 5 seconds. StringPeriodicPublish , MQTTConnection , 3 , protocon/example/string/pub , pub , 0 , 5 , String # String subscribe. Incoming payload is parsed directly into the point. StringSubscribe , MQTTConnection , 4 , protocon/example/string/sub , sub , 0 , - , String # COV JSON template publish. Publishes only when any referenced pid_x point changes. TemplateCovPublish , MQTTConnection , 5 , protocon/example/template/pub , pub , 1 , - , JSON # JSON template subscribe. Updates pid_x values when matching keys are found in the incoming JSON. TemplateSubscribe , MQTTConnection , 6 , protocon/example/template/sub , sub , 1 , - , JSON Points_List Point_Name , Point_Id , Parse_Data_Type , Node_Name , Protocol_Data_Type , Address , Length # Periodic JSON publish: # This creates {"voltage":,"timestamp_ms":,"timestamp_text":"13-Jun-2026 17:00:00"}. PublishVoltage , 100 , float , JsonPeriodicPublish , mqtt_point_id , [str:voltage] , 1 PublishTimestampMillis , 101 , long_int , JsonPeriodicPublish , mqtt_ts_millis , [str:timestamp_ms] , 1 PublishTimestampText , 102 , string , JsonPeriodicPublish , mqtt_ts_datetime , [str:timestamp_text] , 1 # # Nested JSON subscribe: # Example incoming payload: # {"meters":[{"voltage":230.5,"current":12.4}],"quality":"good"} SubscribeNestedVoltage , 200 , float , JsonSubscribe , mqtt_point_id , [str:meters;int:0;str:voltage] , 1 SubscribeNestedCurrent , 201 , float , JsonSubscribe , mqtt_point_id , [str:meters;int:0;str:current] , 1 SubscribeQuality , 202 , string , JsonSubscribe , mqtt_point_id , [str:quality] , 1 # # String publish and subscribe: # For String nodes, Address is not used. PublishStringValue , 300 , string , StringPeriodicPublish , mqtt_point_id , - , 1 SubscribeStringValue , 301 , string , StringSubscribe , mqtt_point_id , - , 1 # # COV JSON template publish: # This creates one complete JSON payload from point IDs 400 and 401. # pid_100, pid_201, tsdatetime, and tsmillis are keywords and are intentionally not quoted. TemplatePayload , 499 , string , TemplateCovPublish , mqtt_json_template , {"device":"PG-R101";"voltage":pid_100;"current":pid_201;"timestamp":tsdatetime;"time_ms":tsmillis} , 1 # # Template subscribe: # Incoming payload example: # {"device":"PG-R101","meter":{"voltage":230.5,"current":12.4},"status":"online","extra_key":"ignored"} # This updates point 500 from meter.voltage, point 501 from meter.current, and point 502 from status. # Static keys such as device are not used for strict matching; their values are not checked. # Missing meter/status keys are ignored without failing the whole message. TemplateSubscribePayload , 599 , string , TemplateSubscribe , mqtt_json_template , {"device":"PG-R101";"meter":{"voltage":pid_200;"current":pid_201};"status":pid_202} , 1