I have windows that have two slider portions per window. Could I create a script (instead of an event) that takes those two window sensors and sets the status of a status only virtual contact sensor? For example if either one is open, the virtual one is open. If both are closed, the virtual is closed?
Announcement
Collapse
No announcement yet.
Script for combining contact sensors?
Collapse
X
-
Originally posted by alexbk66 View PostI'm working on plugin which will allow combining devices easily without using events:
And you can even add the device name which caused the change to the status string:
Sent from my iPhone using Tapatalk
Comment
-
This is what I use to display the status of my motion sensors, windows and doors. This script triggers whenever one of these devices changes state
If there are 2 doors open at the same time, they will both be listed in the door device under each other
Code:dim array_motion() as string = {"Hall motion","Front door motion sensor","Garage Motion Sensor","Motion camera back door","Motion camera garage","Motion camera hall","Motion camera lounge","Motion Lounge"} dim motions_count as integer = 0 dim motion_name as string = "" dim wstr as string = "" sub motion(ByVal Parms as Object) Try motions_count = 0 motion_name = "" wstr = "" for each devw as string in array_motion if hs.DeviceValueByName(devw) = 255 or hs.DeviceValueByName(devw) = 100 then motions_count = motions_count + 1 motion_name = devw wstr = wstr & motion_name & " <span style='color:red'>MOTION</span>" & "<br>" Else If hs.DeviceValueByName(devw) = 0 then end if next If motions_count > 0 then hs.SetDeviceValueByRef(470,100,true) hs.SetDeviceString(470, wstr,true) Else hs.SetDeviceValueByRef(470,0,true) hs.SetDeviceString(470, "No Motion",true) End If hs.writelog("Array", "Motion Sensor Count: " & motions_count) Catch ex As Exception hs.WriteLog ("Array", "Error: " & ex.Message) End Try End Sub
Comment
-
Originally posted by dibble9012 View PostDo you have a release date for your plugin?
https://www.youtube.com/watch?v=mmyrx8kXnWY
Comment
Comment