www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer General Discussion Area

HomeSeer General Discussion Area General discussion about HomeSeer that does not fall into any other category or are not specific to 1.x or 2.x versions of HomeSeer.

Reply
 
Thread Tools Display Modes
  #1  
Old November 28th, 2014, 02:21 PM
Bob_Linux_User's Avatar
Bob_Linux_User Bob_Linux_User is offline
Seer Master
 
Join Date: Feb 2014
Location: Fayetteville, TN
Posts: 576
Command to set Device Parameter

Hi All,

I cannot figure out how to send a value to a device Parameter. What I am trying to do is send a value of 1 to Parameter 2 on a specific device with VB.Net. I can manually perform the function under the Z-Wave Settings tab but need to send the command from a script. Any help would be appreciated.

Bob
Reply With Quote
  #2  
Old November 28th, 2014, 04:11 PM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,886
Have you looked at the Help file?
Do you have vb.net experience or are you looking for more basic help?
Attached Images
  
__________________
Mike____________________________________________________________ __________________
HS3 Pro Edition 3.0.0.435

HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10:
Compose, XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

Reply With Quote
  #3  
Old November 28th, 2014, 05:03 PM
Bob_Linux_User's Avatar
Bob_Linux_User Bob_Linux_User is offline
Seer Master
 
Join Date: Feb 2014
Location: Fayetteville, TN
Posts: 576
Hi Uncle Michael,

I do have access to the Help file. I understand the normal SetDeviceValue commands. What I do not understand is how to select which "Parameter" I want to send a value to. This device has 11 Parameter settings which cause the device (MIMOlite) to be configured for different functionality. If I send a value (any value) to Parameter 2 it causes the internal Pulse Counter to reset to zero. I can reset the device on the Devices Page but it does not send the reset to the MIMOlite to reset the internal counter so when the device sees another pulse the value on the Device Page is not 1 it is the internal counter +1. I do not know if I need to send two bytes of data with byte 1 being the Parameter and byte 2 being the value or even how to send raw data. I hope that made sense.

Bob
Reply With Quote
  #4  
Old November 28th, 2014, 05:11 PM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,886
Sorry. I misunderstood your question.

I think you will have to delve into the new CAPI commands to do what you want. This thread has some useful information.
Reply With Quote
  #5  
Old November 28th, 2014, 06:45 PM
Bob_Linux_User's Avatar
Bob_Linux_User Bob_Linux_User is offline
Seer Master
 
Join Date: Feb 2014
Location: Fayetteville, TN
Posts: 576
Mike,

I looked at the CAPI commands and the thread you referenced but still could not figure this one out. HS does this through the Z-Wave - Settings tab by selecting the Parameter number and the value so I know it can be done but it is beyond me. Thanks for your response.

Bob
Reply With Quote
  #6  
Old November 29th, 2014, 10:56 AM
Uncle Michael's Avatar
Uncle Michael Uncle Michael is offline
OverSeer
 
Join Date: Feb 2006
Location: Rochester, NY
Posts: 5,886
This may not be exactly what you are trying to do, but the exchange in this thread sounds like it might describe a similar problem.

http://board.homeseer.com/showthread.php?p=1147103
Reply With Quote
  #7  
Old November 29th, 2014, 11:17 AM
Bob_Linux_User's Avatar
Bob_Linux_User Bob_Linux_User is offline
Seer Master
 
Join Date: Feb 2014
Location: Fayetteville, TN
Posts: 576
Good Morning Mike,

You may be right. It just seems odd that the Pulse counter (internal counter) cannot be reset from a script. Not much use if the pulse count cannot be set to zero based on predetermined date/time. Thanks again.

Bob
Reply With Quote
  #8  
Old November 29th, 2014, 11:27 AM
Rupp's Avatar
Rupp Rupp is online now
OverSeer
 
Join Date: Jan 2001
Location: Huntsville, Al. USA
Posts: 37,009
You should put in a Bugzilla ticket on this feature request as this is a good idea and useful for many Z-Wave devices.
__________________
-Rupp
Reply With Quote
  #9  
Old November 29th, 2014, 11:38 AM
Bob_Linux_User's Avatar
Bob_Linux_User Bob_Linux_User is offline
Seer Master
 
Join Date: Feb 2014
Location: Fayetteville, TN
Posts: 576
Rupp,

Thanks for the reply. I will put in the bugzilla report. I just cannot help but believe that I am missing something and that a CAPI command can be sent to the device for Parameter 2 and any value (doesn't care). BTW but following another post (smarter people), I now have the Water Usage storing data to a "Flat File" and a tab under view to display a Water Usage Graph. The graph can be Hourly/Daily/Weekly/Monthly .etc depending on the data stored in the Flat File. I am planning on publishing a "How To" document on the forum when I get it put together. Most of the work came from other members on this forum so I cannot really take any credit for the project. I have worked on the SQL database and can create the .mdf and the table from script, but that is as far as I got with that. I got sidetracked by the graphing, which is more fun.

Bob
Reply With Quote
  #10  
Old November 29th, 2014, 12:30 PM
Bob_Linux_User's Avatar
Bob_Linux_User Bob_Linux_User is offline
Seer Master
 
Join Date: Feb 2014
Location: Fayetteville, TN
Posts: 576
I found a program used by someone in another forum that will set the parameter values. The problem is that it is not in vb.net and it would take me a while to figure out his code and excerpt the section that sends the command to parameter 2. I know this is the easy way out, but is someone could look at the code and figure out how to send the configuration commands to the device it would solve my problem and the problem with the new z-wave plus alarm issue also. Any Help from the Gurus?

Bob


Code:
**
 *  MIMOLite Doorbell
 *
*/
metadata {
	definition (name: "MIMOLite Doorbell", namespace: "NTDCS", author: "Adam Newcomb") {
    	capability "Contact Sensor"	
	capability "Refresh"
        capability "Configuration"
        //uncomment for switch
        /*
        capability "Polling"
        capability "Switch"
        */
	}
	simulator {
		// reply messages
		reply "2001FF,delay 100,2502": "command: 2503, payload: FF"
		reply "200100,delay 100,2502": "command: 2503, payload: 00"

		// status messages
		status "open":  "command: 2001, payload: FF"
		status "closed": "command: 2001, payload: 00"

        //uncomment for switch
        /*
        status "on":  "command: 2003, payload: FF"
		status "off": "command: 2003, payload: 00"
        */
	}

	tiles {

        standardTile("contact", "device.contact", inactiveLabel: false) {
			state "open", label: "DingDong!", icon: "st.security.alarm.alarm", backgroundColor: "#ffa81e"
			state "closed", label: " ", icon: "st.security.alarm.clear", backgroundColor: "#79b821"
		}

        standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
			state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
		}

        standardTile("power", "device.power", canChangeIcon: true, canChangeBackground: true)
		{
        	state "off", label: 'OFF', backgroundColor: "#ffa81e", icon:"st.switches.light.off"
        	state "on", label: 'ON', backgroundColor: "#79b821", icon:"st.switches.light.on"
        }

		//uncomment for switch
        /*
		standardTile("switch", "device.switch", canChangeBackground: true, canChangeIcon: true, inactiveLabel: false) {
        	state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
			state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#ffa81e"
        }
        */

        valueTile("voltage", "device.voltage") {
			state("voltage", label:'${currentValue}v', unit:"ADC")
		}


		main (["contact"])

        //uncomment for switch
		details(["contact", "voltage", "refresh", "power" /* , "switch" */])
	}
}

def parse(String description) {

    def result = null
    def cmd = zwave.parse(description, [0x20: 1, 0x84: 1, 0x30: 1, 0x70: 1, 0x31: 3, 0x71: 1])
    if (cmd) {
        result = zwaveEvent(cmd)
        log.debug "parse cmd: '${cmd}' to result: '${result.inspect()}'"
    } else {
        log.debug "parse failed for event: '${description}'"
    }
    result
}

def zwaveEvent(physicalgraph.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd)
{
	log.debug "zwaveEvent SensorBinaryReport: '${cmd}'"
	sensorValueEvent(cmd.sensorValue)
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd)
{
    //BUGBUG_NOTE: this is the event that gets sent from simluated messages and also if subscribed to association group 1
	log.debug "zwaveEvent BasicSet: '${cmd}'"
    sensorValueEvent(cmd.value)
}

def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv3.SensorMultilevelReport cmd)
{
	log.debug "zwaveEvent SensorMultilevelReport: '${cmd}'"

    createEvent( name: "voltage", isStateChange:true, value:cmd.scaledSensorValue,descriptionText: "${device.displayName} measured voltage in ADC Counts")
}

def zwaveEvent(physicalgraph.zwave.commands.alarmv1.AlarmReport cmd)
{
	log.debug "zwaveEvent AlarmReport: '${cmd}'"

    switch (cmd.alarmType) {
        case 8:
            def map = [ name: "power", isStateChange:true]
            if (cmd.alarmLevel){
                map.value="off"
                map.descriptionText = "${device.displayName} lost power"
            }
            else {
                map.value="on"
                map.descriptionText = "${device.displayName} has power"
            }
            createEvent(map)
        break;
		default:
        	[:]
        break;
    }
}

def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
	log.debug "zwaveEvent SwitchBinaryReport: '${cmd}'"
	switchValueEvent(cmd.value)
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
	log.debug "zwaveEvent BasicReport: '${cmd}'"

    switchValueEvent(cmd.value)
}

def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
	log.debug "zwaveEvent ConfigurationReport: '${cmd}'"
    [:]
}

def zwaveEvent(physicalgraph.zwave.commands.associationv2.AssociationReport cmd) {
    cmd.nodeId.each({log.debug "AssociationReport: '${cmd}', hub: '$zwaveHubNodeId' reports nodeId: '$it' is associated in group: '${cmd.groupingIdentifier}'"})
    [:]
}
def zwaveEvent(physicalgraph.zwave.Command cmd) {
	log.debug "zwaveEvent Command not Handled: '${cmd}'"
	// Handles all Z-Wave commands we aren't interested in
	[:]
}

private sensorValueEvent(Short value) {

	def result = []

    if (value) {
    	log.debug "Open sensor value event: $value"
        result << createEvent(name: "contact", value: "open", descriptionText: "$device.displayName is open", isStateChange:true )
	} else {
        log.debug "Closed sensor value event: $value"
		result << createEvent(name: "contact", value: "closed", descriptionText: "$device.displayName is closed", isStateChange:true)
	}

    result
}

private switchValueEvent(Short value)
{
	createEvent([name: "switch", value: value ? "on" : "off", isStateChange:true ])
}


def refresh() {
	log.debug "executing 'refresh'"

    delayBetween([
		zwave.configurationV1.configurationGet(parameterNumber:3).format(),
		zwave.configurationV1.configurationGet(parameterNumber:4).format(),
		zwave.configurationV1.configurationGet(parameterNumber:5).format(),
		zwave.configurationV1.configurationGet(parameterNumber:6).format(),
		zwave.configurationV1.configurationGet(parameterNumber:7).format(),
        zwave.configurationV1.configurationGet(parameterNumber:8).format(),
        zwave.configurationV1.configurationGet(parameterNumber:9).format(),
        zwave.configurationV1.configurationGet(parameterNumber:11).format(),
        zwave.associationV1.associationGet(groupingIdentifier:1).format(),
        zwave.associationV1.associationGet(groupingIdentifier:2).format(),
        zwave.associationV1.associationGet(groupingIdentifier:3).format(),
        zwave.associationV1.associationGet(groupingIdentifier:4).format(),
        zwave.associationV1.associationGet(groupingIdentifier:5).format(),
        zwave.switchBinaryV1.switchBinaryGet().format(),
        zwave.alarmV1.alarmGet(alarmType:8).format(),
        zwave.sensorMultilevelV3.sensorMultilevelGet().format()
	],100)
}

// handle commands
def configure() {
	log.debug "executing 'configure'"

    /*
    8v=11000101 = 197
	7v=11000001 = 193

	4v=2741=10101011 = 171
	5v=2892=10110100 = 180

	.5v=631=00100111=39
	2v=2062=10000000=128

	24v=11101000 = 232
	23v=11100111 = 231

	1.5v=1687=01101001=105
    1.25v=1433=01011001=89
    1.125=1306=01010001=81
	1v=1179=01001001=73
    */
	def cmd = delayBetween([
    	zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, configurationValue: [1]).format(),  // clear pulse meter counts
    	zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, configurationValue: [1]).format(),  // sig 1 triggers relay
        zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, configurationValue: [100]).format(),  // lower threshold, high
        zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, configurationValue: [39]).format(),  // lower threshold, low
        zwave.configurationV1.configurationSet(parameterNumber: 6, size: 1, configurationValue: [232]).format(),  // upper threshold, high
        zwave.configurationV1.configurationSet(parameterNumber: 7, size: 1, configurationValue: [231]).format(),  // upper threshold, low
        zwave.configurationV1.configurationSet(parameterNumber: 8, size: 1, configurationValue: [1]).format(),  // set to analog, below bounds
        zwave.configurationV1.configurationSet(parameterNumber: 9, size: 1, configurationValue: [255]).format(),  // disable periodic reports
        zwave.configurationV1.configurationSet(parameterNumber: 11, size: 1, configurationValue: [0]).format(),  // momentary relay
        zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:zwaveHubNodeId).format(),	//subscribe to basic sets on sig1
        zwave.associationV1.associationSet(groupingIdentifier:2, nodeId:zwaveHubNodeId).format(),	//subscribe to basic multisensorreports
        zwave.associationV1.associationSet(groupingIdentifier:3, nodeId:zwaveHubNodeId).format(),	//subscribe to power alarm
        zwave.associationV1.associationRemove(groupingIdentifier:4, nodeId:zwaveHubNodeId).format(),	//unsubscribe from binary sensor reports
        zwave.associationV1.associationRemove(groupingIdentifier:5, nodeId:zwaveHubNodeId).format()	//unsubscribe from pulse meter events
	],100)
    //associationRemove
}

//uncomment for switch
/*
def poll() {
	// If you add the Polling capability to your device type, this command will be called approximately
	// every 5 minutes to check the device's state
	//zwave.basicV1.basicGet().format()
}

def on() {
	delayBetween([
		zwave.basicV1.basicSet(value: 0xFF).format(),
		zwave.switchBinaryV1.switchBinaryGet().format()
	],100)
}

def off() {
	delayBetween([
		zwave.basicV1.basicSet(value: 0x00).format(),
		zwave.switchBinaryV1.switchBinaryGet().format()
	],100)
}
*/
Reply With Quote
  #11  
Old November 29th, 2014, 03:55 PM
Bob_Linux_User's Avatar
Bob_Linux_User Bob_Linux_User is offline
Seer Master
 
Join Date: Feb 2014
Location: Fayetteville, TN
Posts: 576
I have attached the "How To" .pdf to create the pulse data (or any other device that changes value) and graph the data through HS3.

Bob
Attached Images
File Type: pdf Charting Water usage data with Dygraph in HS3.pdf (397.2 KB, 65 views)

Last edited by Bob_Linux_User; November 30th, 2014 at 09:42 PM. Reason: Updated/Corrected attachment
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can send command only once to a device The Doge HS2 / HSPRO 12 June 29th, 2015 01:26 PM
Script to list device parameter settings ksum HomeSeer Z-Wave Plug-in 13 January 7th, 2014 11:55 PM
capture a device command ntanghe2 HS2 / HSPRO 2 September 4th, 2006 03:02 PM
Device Command jdls HS2 / HSPRO 0 June 30th, 2006 07:50 AM


All times are GMT -4. The time now is 02:00 PM.


Copyright HomeSeer Technologies, LLC