[RELEASE] Salus SP600 Smart Plug

Although the Salus SP600 Smart Plug works with the built in Generic ZigBee Outlet type for on/off control, the power reporting didn't work for me.

I pulled together the below which seems to do the trick.

/**
 * 
 *  Driver for Salus SP600 Smart Plug *
 *  
 *	
 */


metadata {

	definition (name: "Salus SP600 Smart Plug", namespace: "Salus", author: "Salus") {

		capability "Configuration"
		capability "Switch"
		capability "Power Meter"
		capability "Refresh"

		fingerprint profileId: "0104", inClusters: "0000, 0001, 0003, 0004, 0005, 0006, 0402, 0702, FC01", outClusters: "0019", manufacturer: "Computime", model: "SP600", deviceJoinName: "Salus SP600 Smart Plug"
	}

}


preferences {
	
	input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
	input name: "txtEnable", type: "bool", title: "Enable descriptionText logging", defaultValue: true
	
}



def initialize() {
	
	log.warn "Initialize Called!"

	configure()
	
}

def logsOff(){

	log.warn "debug logging disabled!"

	device.updateSetting("logEnable",[value:"false",type:"bool"])

}

def updated(){

	log.info "Updated Called!"

	log.warn "debug logging is: ${logEnable == true}"
	log.warn "description logging is: ${txtEnable == true}"
	
	if (logEnable) runIn(1800,logsOff)

}

def parse(String description) {

	if (logEnable) {
		
		log.debug "Parse Called!"
		log.debug "description is $description"

	}
	
	def eventMap = zigbee.getEvent(description)

	if (!eventMap) {
		
		eventMap = getDescription(zigbee.parseDescriptionAsMap(description))	

	}

	if (eventMap) {
	
		if (txtEnable) log.info "$device eventMap name: ${eventMap.name} value: ${eventMap.value}"

		sendEvent(eventMap)

	}
	else {
		
		log.warn "DID NOT PARSE MESSAGE for description: $description"			
		
		def descriptionMap = zigbee.parseDescriptionAsMap(description)
		if (logEnable) log.debug "descriptionMAp: $descriptionMap"			

	}	

}

def off() {

	zigbee.off()

}

def on() {

	zigbee.on()

}

def refresh() {
	
	if (logEnable) log.debug "Refresh Called!"
	
	zigbee.onOffRefresh() + simpleMeteringPowerRefresh()

}

def configure() {

	if (logEnable) log.debug "Configure Called!"

	zigbee.onOffConfig() + simpleMeteringPowerConfig() + zigbee.onOffRefresh() + simpleMeteringPowerRefresh()

}

def simpleMeteringPowerRefresh() {

	zigbee.readAttribute(0x0702, 0x0400)

}

def simpleMeteringPowerConfig(minReportTime=1, maxReportTime=600, reportableChange=0x05) {

	zigbee.configureReporting(0x0702, 0x0400, DataType.INT24, minReportTime, maxReportTime, reportableChange)

}

def getDescription(descMap) {

	def powerValue = "undefined"

	if (descMap.cluster == "0702") {

		if (descMap.attrId == "0400") {

			if(descMap.value != "ffff") powerValue = zigbee.convertHexToInt(descMap.value)

		}

	}
	else if (descMap.clusterId == "0702") {

		if(descMap.command == "07"){

			return	[name: "update", value: "power (0702) capability configured successfully"]

		}

	}
	else if (descMap.clusterId == "0006") {

		if(descMap.command == "07"){

			return	[name: "update", value: "switch (0006) capability configured successfully"]

		}

	}

	if (powerValue != "undefined"){

		return	[name: "power", value: powerValue]

	}
	else {

		return null

	}

}
4 Likes

I have just started using this driver with a couple of SP600s and it works great. They seem to be good reliable units too and reasonably priced.

The only issue I have is that they do seem to be very "chatty". When one of mine is detecting power use it reports it many times a minute even if the energy has only changed by a small amount.

Ideally I'd like it to only report every 30 seconds minimum if possible.

I did try adjusting the minReportTime= from 1 to 30 to see if that made a difference but it didn't seem to so rather than mess about any more I thought I would see if anyone knows what I need to adjust.

EDIT. Ignore the above. I just needed to re configure the device, then the minReportTime value took effect correctly and it only updates at a minimum of 30 seconds.

@patrick @mike.maxwell Is there any chance of getting this added as an official driver?

The driver above works well and I have discovered that the device will accept minReportTime values from 1 to 30 seconds (I haven't tried higher) and that the "reportableChange=0x05" which seems to be power in Watts can be changed too. I have used 0x01 for 1W and 0xA0 for 10W successfully. I always prefer to use an official driver when possible though but there doesn't seem to be a generic Zigbee Smart Socket Driver to test this unit on.

They're great little units and we are quite limited in the UK with energy monitoring sockets, official support for these would be very useful.

I am happy to provide any further info you would need and to carry out any testing.

3 Likes

Got one of these today and integrated it to my setup.
Great little outlet and I think this is my new goto outlet.