Skip to the content.

Back

Multi Sensors

To control the multi sensors, a user have to follow the MQTT2GO convention. To ease up the setup, this page is dedicated to the command and report messages utilized for such communication.

Commands

As specified by the MQTT2GO convention, the commands are utilized for device control. In the following subsection, we present the standardized way which is following the convention.

Set On

{
	"type": "command",
	"timestamp": 1567677926,
	"command_type": "set",
	"value": "on"
}

Set Off

{
	"type": "command",
	"timestamp": 1567677926,
	"command_type": "set",
	"value": "off"
}

Query Temperature

{
	"type": "command",
	"timestamp": 1567677926,
	"command_type": "query",
	"value": "temperature"
}

Query Humidity

{
	"type": "command",
	"timestamp": 1567677926,
	"command_type": "query",
	"value": "humidity"
}

Query Motion

{
	"type": "command",
	"timestamp": 1567677926,
	"command_type": "query",
	"value": "motion"
}

Query Smoke

{
	"type": "command",
	"timestamp": 1567677926,
	"command_type": "query",
	"value": "smoke"
}

Query Water

{
	"type": "command",
	"timestamp": 1567677926,
	"command_type": "query",
	"value": "water"
}

Reports

Reports are utilized either as responses to the commands or to report periodic or critical event.

State Report

{
	"type": "report",
	"priority_level": 2,
	"report_type":"report_type",
	"timestamp": 1567677956,
	"report_name": "state",
	"report": "on"
}
{
	"type": "report",
	"priority_level": 2,
	"report_type": "report_type",
	"timestamp": 1567677956,
	"report_name": "state",
	"report": "off"
}
{
	"type": "report",
	"priority_level": 2,
	"report_type": "report_type",
	"timestamp": 1567677956,
	"report_name": "state",
	"report": "repair_needed"
}

Temperature Report

{
	"type": "report",
	"priority_level": 2,
	"report_type": "report_type",
	"timestamp": 1567677956,
	"report_name": "temperature",
	"report": {
		"value:": 21.8,
		"unit": "C"
	}
}

Humidity Report

{
	"type": "report",
	"priority_level": 2,
	"report_type": "report_type",
	"timestamp": 1567677956,
	"report_name": "humidity",
	"report": {
		"value": 35.5,
		"unit": "%"
	}
}

Motion Report

{
	"type": "report",
	"priority_level": 2,
	"report_type": "report_type",
	"timestamp": 1567677956,
	"report_name": "motion",
	"report": "motion"
}

Smoke Report

{
	"type": "report",
	"priority_level": 2,
	"report_type": "report_type",
	"timestamp": 1567677956,
	"report_name": "smoke",
	"report": "smoke"
}

Water Report

{
	"type": "report",
	"priority_level": 2,
	"report_type": "report_type",
	"timestamp": 1567677956,
	"report_name": "water",
	"report": "water"
}

Back