Monitor temperature and turn on a switch if no change after 4 hours?

You can try using my instructions

Here is Rules API template for monitoring temperature changes

	   {
		 "if": {
		  "changes": {
			"operand": {
			  "device": {
				"devices": [
				  "-- temperature measurement ID --"
				],
				"component": "main",
				"capability": "temperatureMeasurement",
				"attribute": "temperature"
			  }
			}
		  },
		   "then": [
			  {
				"command": {
				  "devices": [
					"-- virtual switch ID --"
				  ],
				  "commands": [
					{
					  "component": "main",
					  "capability": "switch",
					  "command": "on"
					}
				  ]
				}
			  },		  
			  {
				"sleep": {
					"duration": {
						"value": {
							"integer": 1
						},
						"unit": "minute"
					}
				}
			  },
			  {
				"command": {
				  "devices": [
					"-- virtual switch ID --"
				  ],
				  "commands": [
					{
					  "component": "main",
					  "capability": "switch",
					  "command": "off"
					}
				  ]
				}
			  }	
			]
		}
	   }		 

Virtual switch makes 1 minute pulse every time temperature changes.

Notification using ST App routine

3 Likes