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
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 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.
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)
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 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.
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.
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.