<commit_before>/**
 *  
 *	Fibaro FGS-222 Double Relay Switch Device Type
 *  
 *	Original Author: <NAME>
 *	Date: 2017-01-18 
 *  Modified by: (C) CSC 2017-08-12
 *  Change 
 */
 
metadata {
definition (name: "Fibaro FGS-222 Double Relay Switch", namespace: "csc", author: "CSC") {
capability "Switch"
capability "Relay Switch"
capability "Polling"
capability "Configuration"
capability "Refresh"
capability "Zw Multichannel"

attribute "switch1", "string"
attribute "switch2", "string"

command "on1"
command "off1"
command "on2"
command "off2"

fingerprint deviceId: "0x1001", inClusters:"0x86, 0x72, 0x85, 0x60, 0x8E, 0x25, 0x20, 0x70, 0x27"

}

simulator {
status "on": "command: 2003, payload: FF"
status "off": "command: 2003, payload: 00"

// reply messages
reply "2001FF,delay 100,2502": "command: 2503, payload: FF"
reply "200100,delay 100,2502": "command: 2503, payload: 00"
}

tiles(scale: 2){

    multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
			tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
				attributeState "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
				attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
			}
	}
	standardTile("switch1", "device.switch1",canChangeIcon: true, width: 3, height: 3) {
		state "on", label: "switch1", action: "off1", icon: "st.switches.switch.on", backgroundColor: "#79b821"
		state "off", label: "switch1", action: "on1", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
    }
	standardTile("switch2", "device.switch2",canChangeIcon: true, width: 3, height: 3) {
		state "on", label: "switch2", action: "off2", icon: "st.switches.switch.on", backgroundColor: "#79b821"
		state "off", label: "switch2", action: "on2", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
    }
    standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
    }

    standardTile("configure", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "default", label:"", action:"configure", icon:"st.secondary.configure"
    }

    main(["switch","switch1", "switch2"])
    details(["switch","switch1","switch2","refresh","configure"])
}
   
   
   preferences {
        def paragraph = "Device Handler by @RobinWinbourne"
        input name: "param1", type: "number", range: "0..255", defaultValue: "255", required: true,
            title: paragraph + "\n\n" +
                   "Parameter Settings: \n\n" +
                   "Parameter No. 1 - Activate / deactivate functions ALL ON / ALL OFF. \n" +
                   "255 - ALL ON active, ALL OFF active,\n" +
                   "0 - ALL ON is not active ALL OFF is not active,\n" +
                   "1 - ALL ON is not active ALL OFF active,\n" +
                   "2 - ALL ON active ALL OFF is not active.\n" +
                   "Default value: 255."
       
        input name: "param3", type: "number", range: "0..1", defaultValue: "0", required: true,<commit_msg>Update FibaroDoubleRelayFGS222.groovy<commit_after>/**
 *  
 *	Fibaro FGS-222 Double Relay Switch Device Type
 *  
 *	Original Author: <NAME>
 *	Date: 2017-01-18 
 *  Modified by: (C) CSC 2017-08-12
 *  Change to use for curtain motor
 */
 
metadata {
definition (name: "Fibaro FGS-222 Double Relay Switch", namespace: "smartthings", author: "<NAME>") {
capability "Switch"
capability "Relay Switch"
capability "Polling"
capability "Configuration"
capability "Refresh"
capability "Zw Multichannel"

attribute "switch1", "string"
attribute "switch2", "string"

command "on1"
command "off1"
command "on2"
command "off2"

fingerprint deviceId: "0x1001", inClusters:"0x86, 0x72, 0x85, 0x60, 0x8E, 0x25, 0x20, 0x70, 0x27"

}

simulator {
status "on": "command: 2003, payload: FF"
status "off": "command: 2003, payload: 00"

// reply messages
reply "2001FF,delay 100,2502": "command: 2503, payload: FF"
reply "200100,delay 100,2502": "command: 2503, payload: 00"
}

tiles(scale: 2){
/*
    multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
			tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
				attributeState "on", label: '${name}', action: "switch.off", icon: "st.contact.contact.open", backgroundColor: "#79b821"
				attributeState "off", label: '${name}', action: "switch.on", icon: "st.contact.contact.closed", backgroundColor: "#ffffff"
			}
	}
*/
	standardTile("switch1", "device.switch1",canChangeIcon: true, width: 3, height:3) {
		state "on", label: "Open", action: "off1", icon: "st.contact.contact.open", backgroundColor: "#79b821"
		state "off", label: "Open", action: "on1", icon: "st.contact.contact.open", backgroundColor: "#ffffff"
	}
	standardTile("switch2", "device.switch2",canChangeIcon: true, width: 3, height: 3) {
		state "on", label: "Close", action: "off2", icon: "st.contact.contact.closed", backgroundColor: "#79b821"
		state "off", label: "Close", action: "on2", icon: "st.contact.contact.closed", backgroundColor: "#ffffff"
    }
    standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
    }

    standardTile("configure", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "default", label:"", action:"configure", icon:"st.secondary.configure"
    }

    main(["switch","switch1", "switch2"])
    details(["switch","switch1","switch2","refresh","configure"])
}
   
   
   preferences {
        def paragraph = "Device Handler by @RobinWinbourne"
        input name: "param1", type: "number", range: "0..255", defaultValue: "255", required: true,
            title: paragraph + "\n\n" +
                   "Parameter Settings: \n\n" +
                   "Parameter No. 1 - Activate / deactivate functions ALL ON / ALL OFF. \n" +
                   "255 - ALL ON active, ALL OFF active,\n" +
                   "0 - ALL ON is not active ALL OFF is not active,\n" +
                   "1 - ALL ON is not active ALL OFF active,\n" +
                   "2 - ALL ON active ALL OFF is not active.\n" +
                   "Default value: 255."
       
        input name: "param3", type: "number", range: "0..1", defaultValue: "0", required: true,
{'fraction_non_alphanumeric': 0.16444444444444445, 'fraction_numerical': 0.05103448275862069, 'mean_word_length': 3.6814921090387376, 'pattern_counts': {'":': 8, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2366240', 'n_tokens_mistral': 2387, 'n_tokens_neox': 2110, 'n_words': 618}