Hi all
this is a piece of a script , and i dont know why he doesnt speak the last value from this line: If error_count = 0 Then
there is no error , so normal he would need to trigger...
regards
this is a piece of a script , and i dont know why he doesnt speak the last value from this line: If error_count = 0 Then
there is no error , so normal he would need to trigger...
PHP Code:
pirdisabled_count = 0
pirenabled_count = 0
error_count = 0
pir_name = ""
pstr = ""
For Each devp As String In array_pir
dv = hs.GetDeviceByRef(devp)
location = dv.location(hs)
pir_name = dv.Name(hs)
Select Case hs.DeviceValue(devp)
Case 0
pirenabled_count = pirenabled_count + 1
hs.speak(pir_name & " at the " & location & " is standby")
Case 1
hs.speak("person detected in the " & location)
Case 11
pirdisabled_count = pirdisabled_count + 1
hs.speak(pir_name & " at the " & location & " is Disabled")
Case 15
hs.speak("P I R in the ** is Enabled")
Case 9
pirdisabled_count = pirdisabled_count + 0
hs.speak(" battery ")
Case Else
error_count = error_count + 1
hs.speak (pir_name & " at the" & location & " has an error")
End Select
Next
hs.speak ("There are " & pirenabled_count & " Sensors Enabled ")
hs.speak ("And " & pirdisabled_count & " Sensors Disabled ")
If pirEnabled_count > 0 Then
hs.writelog("Array", "enabled pir's: " & pirenabled_count)
If pirdisabled_count > 0 Then
hs.writelog("Array", "disabled pir's: " & pirdisabled_count)
If error_count = 0 Then
hs.writelog("Array", "Errors: " & error_count)
hs.speak ("no Errors found")
Else
End If
End If
End if
regards
Comment