Help needed with rule JSON for mqtt integration

does this look right

{
  "name": "Every 10 min copy temp - MQTT",
  "actions": [
        {
            "every": {
                "interval": {
                    "value": {
                        "integer": 10
                    },
                    "unit": "Minute"
                  },
			  "actions": [
						 {
						"command": {
						  "devices": [
							"653412aa-1673-4cb3-9fce-6cc078b23fc2"
						  ],
						  "commands": [
							{
							  "component": "main",
							  "capability": "MQTT Temperature",
							  "command": "setvTemp",
							  "arguments": [
								{
								  "device": {
									"devices": [
									  "345b67db-f64e-44a0-8c60-e1e093baa89d"
									],
									"component": "main",
									"capability": "temperatureMeasurement",
									"attribute": "temperature"
								  }
								}
							  ]
							}
						  ]
						}
					  }
					]
	         }
	     }
	]
}

Yes
You have changed to rule yours device IDs

1 Like

Use in CLI command
smartthings rules:create -j -l location_id -i RulesAPI_xxxx.json -t token

location_id = your location ID
RulesAPI_xxxx.json = your Rules API rule file name

I think that when you are making first rule you also need auth token
-t, --token= the auth token to use

“MQTT Temperature” is wrong
You have to use “capability”: “partyvoice23922.vtempset”

{
  "name": "Every 10 min copy temp - MQTT",
  "actions": [
        {
            "every": {
                "interval": {
                    "value": {
                        "integer": 10
                    },
                    "unit": "Minute"
                  },
			  "actions": [
						 {
						"command": {
						  "devices": [
							"653412aa-1673-4cb3-9fce-6cc078b23fc2"
						  ],
						  "commands": [
							{
							  "component": "main",
							  "capability": "partyvoice23922",
							  "command": "setvTemp",
							  "arguments": [
								{
								  "device": {
									"devices": [
									  "345b67db-f64e-44a0-8c60-e1e093baa89d"
									],
									"component": "main",
									"capability": "temperatureMeasurement",
									"attribute": "temperature"
								  }
								}
							  ]
							}
						  ]
						}
					  }
					]
	         }
	     }
	]
}

You have changed my example. Change only device IDs. Keep everything else.

2 Likes

thanks
martin

1 Like