[RELEASE] GoControl Door/Window Sensor, Motion Sensor, and Siren DTH

Thanks Kevin for the DH for the GoControl Motion Sensor. It works great except for one thing. The tile that shows the Tamper status always shows “Tamper Detected” in red even when I see in the debug log:

2016-07-28 7:03 PM PDT - 2 hours ago tamper clear 2016-07-28 7:02 PM PDT - 2 hours ago tamper detected 2016-07-28 7:02 PM PDT - 2 hours ago tamper detected 2016-07-28 7:02 PM PDT - 2 hours ago tamper detected

Any idea why?

Have you tried tapping the “Refresh” tile?

Tried:

  1. tapping refresh tile
  2. taking battery out, putting it back in
  3. pressing the tamper button for 5 seconds

For now in
valueTile("tampering",...

I interchanged the

state "clear", ... 
state "detected" ...`

statements

That’s odd, this version’s been out for a month and your the only person that’s had the problem.

Are you using the Android or iPhone app and what kind of phone is it?

The only time the order of those matter is when the attribute doesn’t match one of the items in the list. If you open the device in the IDE, what’s shown next to tamper?

It’s an iPhone. I’m running the latest version of the app.

In the IDE this is what I can see:

temperature: 23 C
battery: 100 %
motion: inactive
tamper: clear
lastPoll: 1469810970840

It’s nice to see that it can report the temperature in Celsius, that’s something I wasn’t able to test.

I would like to figure out what’s causing the problem rather than fixing it by reversing the lines because it could be affecting other things too.

Can you switch back to the version before you made the change and see if it goes back to red. Make sure you don’t have the device open in the mobile app while updating the DTH.

If it’s still showing clear, can you then try opening the back cover and verify that it turns red again.

If it’s now red, close the back cover and wait about 1 minute.

Then press the “Reset” button in the mobile app and see if it changes back to clear.

If it doesn’t change back to clear, back out to the main “Things” screen and open the device again and see if it’s still showing the wrong state.

I updated the code to the original from your github and it is now showing red

Do you want me to take off the back cover, wait 1 minute and then put it back again? I’ve tried that before and it still stays red

Can you open live logging in the IDE, perform the steps below and then post the live logging data:

  1. Open the device settings/preferences from the mobile app and enable logging if it’s off and then press done.

  2. Open the back cover, wait about 15 seconds, and then close it.

  3. Wait a few additional seconds and then press the Reset button.

  4. Go back to live logging in the IDE, and click the name of the device so that only that devices entries are showing.

  5. Copy and paste the logging info into a post.

Thanks

de98329d-216f-4df0-9534-5729dd7be429 9:26:07 PM: debug Hall motion sensor: The re-trigger wait time will be sent to the device the next time it wakes up. If you want this change to happen immediately, open the back cover of the device until the red light turns solid and then close it. de98329d-216f-4df0-9534-5729dd7be429 9:26:07 PM: debug Hall motion sensor: Resetting Tamper de98329d-216f-4df0-9534-5729dd7be429 9:25:49 PM: debug Hall motion sensor: Motion is active de98329d-216f-4df0-9534-5729dd7be429 9:25:48 PM: debug Hall motion sensor: Ignoring new temperature of 24° because the change is within the 1° threshold. de98329d-216f-4df0-9534-5729dd7be429 9:25:48 PM: debug Hall motion sensor: Battery: 100% de98329d-216f-4df0-9534-5729dd7be429 9:25:47 PM: debug Hall motion sensor: Setting re-trigger wait time to 3 minutes de98329d-216f-4df0-9534-5729dd7be429 9:25:47 PM: debug Hall motion sensor: Woke Up de98329d-216f-4df0-9534-5729dd7be429 9:25:32 PM: debug Hall motion sensor: Tampering Detected de98329d-216f-4df0-9534-5729dd7be429 9:25:11 PM: debug Hall motion sensor: Tampering Detected de98329d-216f-4df0-9534-5729dd7be429 9:24:47 PM: debug Hall motion sensor: Motion is active

Everything from 9:26 onwards is when I pressed the reset (on the ST app)

If you go back to the main Things screen and then open the device again, does it still show up as tamper detected?

That’s the weird part

temperature: 25 C
battery: 100 %
motion: inactive
tamper: clear
lastPoll: 1469939336338

When I go to Devices, it shows tamper as “clear” - however, the icon on the ST app is still red.

When you swapped those 2 lines, did it still show clear when tamper was detected?

Tried the following scenario:
swap lines
open box cover
wait 15 seconds
reset

Here’s the log
de98329d-216f-4df0-9534-5729dd7be429 10:02:37 PM: debug Hall motion sensor: The re-trigger wait time will be sent to the device the next time it wakes up. If you want this change to happen immediately, open the back cover of the device until the red light turns solid and then close it. de98329d-216f-4df0-9534-5729dd7be429 10:02:37 PM: debug Hall motion sensor: Resetting Tamper de98329d-216f-4df0-9534-5729dd7be429 10:02:17 PM: debug Hall motion sensor: Motion is active de98329d-216f-4df0-9534-5729dd7be429 10:02:17 PM: debug Hall motion sensor: Ignoring new temperature of 25° because the change is within the 1° threshold. de98329d-216f-4df0-9534-5729dd7be429 10:02:17 PM: debug Hall motion sensor: Battery: 100% de98329d-216f-4df0-9534-5729dd7be429 10:02:16 PM: debug Hall motion sensor: Setting re-trigger wait time to 3 minutes de98329d-216f-4df0-9534-5729dd7be429 10:02:16 PM: debug Hall motion sensor: Woke Up de98329d-216f-4df0-9534-5729dd7be429 10:02:07 PM: debug Hall motion sensor: Tampering Detected de98329d-216f-4df0-9534-5729dd7be429 10:01:48 PM: debug Hall motion sensor: Tampering Detected

The tamper detected was red very very briefly when I started the app and then changed to clear.

I did some research into this (because I also have iOS, and was having the same issue), and apparently the valueTile can act differently across both iOS and Android. From what I can tell, you can’t have multiple states inside of a valueTile, at least not in iOS. See this post thread, which seems to insinuate that (specifically the question being asked, and the third post): Can a valueTile have more than one dynamic value?

So, I made a small update to the tile code for the tampering tile. I updated it to use a standardTile instead of a valueTile. This lost some of the text that could be displayed, so I updated that too so it would fit. See code below:

standardTile("tampering", "device.tamper", width: 2, height: 2) {
			state "detected", label:"Tamper Yes", backgroundColor: "#ff0000"
			state "clear", label:"Tamper No", backgroundColor: "#cccccc"			
		}

It’s not a perfect solution, and I don’t know what it would do on Android, or any other mobile OS, but it helps out in iOS. Feel free to take/use it as you please.

I can confirm that at least on iOS, valueTile does not allow for multiple states. The option is to either use standardTile with multiple states OR valueTile with something like
title: ‘Tamper\n${currentValue}’

Thanks for the confirmation George! Makes my whole afternoon not feel wasted :slight_smile: I did get the ${currentValue} piece to work inside of the valueTile, but I couldn’t get the tile to change colors appropriately. Even with a backgroundColors array, it would always default to the first value in the array, regardless of what value I put in the first slot. I theorized that the tile wasn’t getting the updated value (although I thought that was odd because ${currentValue} always showed the correct value) and decided to scrap it and go with the standardTile so I could have the color change. Basically, I valued the color change over everything else because I felt that it made it easier to notice a change when looking at the device in the app.

Thanks for figuring out the cause. If you’re also using my GoControl Door/Window Sensor DTH, can you check to see if that one always displays clear?

Thanks for confirming.

I appreciate the fix and I changed it to a standard tile, but the label change caused issues in the android app.

I ended up adding it as a secondary control so you can actually read what it says and I changed the tile labels to just “Tamper” and “No Tamper” so that even when the label cuts off, you can still kind of read it.

Please let me know if these changes look OK in the iOS app.

I tried the updated code, and the secondary control looks a bit odd in iOS. See attached screenshot:

Note the little “Tamper Clear” tag, with icon, in the area where it shows if there is motion or not. Does Android do this also? I’m fine with having the forked version of 1.1, basically creating an iOS and an Android version.

Regarding the door/window sensor, I do have a Go Control door/window sensor but haven’t used your device type (the generic one is working for my needs). That being said, I did look over the code and noted that it would run into the same issue as the motion controller in iOS.

I appreciate the quick update and all the hard work you’ve done! I’m apologizing in advance as my responsiveness will slow with the work week starting up. I’ll do my best to check the thread for any updates and continue to test as needed. :smile:

That change was more out of curiousity to see what it would look like and since it caused that problem in iOS, I’ve removed it.

Having 2 versions becomes a mess and based on your screenshot, the tamper tile looks the same on both devices so unless a new problem is found, version 1.2.1 that I just released is the official version for Android and iOS.

Now that I’m aware of this iOS issue, I’ll go through my other DTHs and fix any of them that may have this problem.

Just updated to version 1.2.1 and can confirm that the extra tile is missing in iOS also, thanks!

I’m totally on board with you about not wanting to maintain two separate versions, especially with only a small difference between the two.

Again, thanks for your quick updates, they are appreciated!