www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer Help

HomeSeer Help Help, How-to's and Documentation

Reply
 
Thread Tools Display Modes
  #1  
Old March 9th, 2017, 08:51 AM
UMWarEagle UMWarEagle is offline
Viewer
 
Join Date: Mar 2016
Location: Georgia
Posts: 3
Alert Lights

I am having a problem trying to figure out how to do something with an event.

I have set up a manually triggered event that when called will flash selected z-wave lights in the house on and off 5 times. Basically this event runs a “Control a Device” command to set lights on, then waits 1 second, then “Control a Device” command to set lights off, then wait 1 second, and it repeats this four more times. What I would like for the event to do is return the lights to the original state they were in before the event ran: if a particular light was on when the event ran it would be on at the end of the event, if the light was off when the event ran it would be off at the end of the event. This would have been easy if there had been a "Control a Device" option to change device state (i.e. if device was on turn it off), but that unfortunately is not an option.

I have tried using counters for each of the lights (checking to see if light is on or off at the beginning of the event by using another event), but just cannot seem to get it to work correctly.

Has anyone else tried to do this and had any success?
Reply With Quote
  #2  
Old March 9th, 2017, 09:12 AM
sparkman's Avatar
sparkman sparkman is offline
OverSeer
 
Join Date: Oct 2001
Location: Calgary, Alberta, Canada
Posts: 6,007
I would use scripts to do this. There's an example I posted here: https://forums.homeseer.com/showthread.php?p=1288685 that allows you to store the original device value and at the end of your flashing, read the values back and set the devices based on that.

Cheers
Al
__________________
HS3Pro 3.0.0.318 on Jetway JBC501F9Q-Q87-B i7 8GB 1874 Devices, 955 Events, 28 Plugins
Z-Wave 3.0.1.131 Z-Net 105 nodes:Leviton Vizia,Kwikset,FortrezZ Valve/Sensors,Everspring Sensors/Modules/Outlets,CT30 Stats,MIMOLites,Aeotec Smart Switches
RFXCom W800,RFXrec433,RFXtrx433|APCUPSD|Pushover|Squeezebox|weatherXML|HS Phone W2C|APCUPSD|UltraLog
UltraGCIR GC-100|UltraNetcam|UltraPioneer|Ultra1Wire|DSC PC1832|BLLED|BLTVGuide|ImperiHome|jon00 Utilities|MySensors

PHLocation|X10 CM11A IOLinc,etc
Reply With Quote
  #3  
Old March 9th, 2017, 09:20 AM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 435
You want to be able to toggle the light.

I know of two ways to do this. One is the EasyTrigger Plug-in. It has a lot of nice features, toggle included.

The other method is a script. I have attached the one I use which was posted by one of the HS guys sometime back.

Code:
Sub Main(ByVal Parms As Object)

	Dim DvRef As Integer = Parms
	'Dim DvSet As String
	
	Select Case IsOnCapi(DvRef)
		Case TRUE
			CallCAPI(DvRef, "Off")
			
		Case FALSE
			CallCAPI(DvRef, "On")
	End Select	

End Sub

'Control Device
Function CallCAPI(ByVal intDevRef As Integer, ByVal strDevCmd As String) As CAPIControlResponse
	CallCAPI = CAPIControlResponse.Indeterminate
	For Each objCAPIControl As CAPIControl In hs.CAPIGetControl(intDevRef)
		If LCase(objCAPIControl.Label) = LCase(strDevCmd) Then
			CallCAPI = hs.CAPIControlHandler(objCAPIControl)
			Exit For
		End If
	Next
End Function

'IsOn
Function IsOnCAPI(ByVal intDevRef As Integer) As Boolean
	Dim intValue = hs.DeviceValueEx(intDevRef)

	IsOnCAPI = False
	For Each objCAPIControl As CAPIControl In hs.CAPIGetControl(intDevRef)
		If intValue = objCAPIControl.ControlValue Then
			If LCase(objCAPIControl.Label) = "on" Then
				IsOnCAPI = True
			End If
			Exit For
		End If
	Next
End Function

'IsOff
Function IsOffCAPI(ByVal intDevRef As Integer) As Boolean
	Dim intValue = hs.DeviceValueEx(intDevRef)

	IsOffCAPI = False
	For Each objCAPIControl As CAPIControl In hs.CAPIGetControl(intDevRef)
		If intValue = objCAPIControl.ControlValue Then
			If LCase(objCAPIControl.Label) = "off" Then
				IsOffCAPI = True
			End If
			Exit For
		End If
	Next
End Function
The parameter is the Device Reference Number.
Attached Images
 
__________________
Brady
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 On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get alert information from a script with Alert#:Trigger# mrceolla WeatherXML 6 August 5th, 2016 05:54 PM
Alert lights on and initialisation Delboy BLSecurity (3P) 0 July 12th, 2010 09:25 AM
X10 on turns lights on, missing off leaves lights on. Help! richtj99 HS2 / HSPRO 12 July 2nd, 2007 01:03 AM
Turn off outside lights after an Alarm event ONLY if lights are supposed to be off bradhs HS2 / HSPRO 1 April 27th, 2007 03:16 AM
X10 Received D1 D All Lights Off doesnt set all D lights jeremylaurenson HS2 / HSPRO 0 October 28th, 2006 12:11 PM


All times are GMT -4. The time now is 12:42 PM.


Copyright HomeSeer Technologies, LLC