That seems to work, thank you!
In the setup instructions you say to create a new device ātypeā. Is that the same as a New Device Handler or is that just creating a New Device?
See the community FAQ on custom code. It will explain the terminology used and the basic process. (The topic title is a clickable link)
I have three WSTs (2 humidity/temp sensors, 1 moisture sensor) and the WST hub. Theyāre all hooked up and working fine. Iām using them along with IFTTT to control a room humidifier. But now Iād like to make use of the ST integration to control some other stuff. Iām having problems getting the tags added into ST. Iāve read the community FAQ several times, but am still puzzled. Hereās what Iāve tried to get them into ST:
- In the ST IDE I created a new smart app copy/pasting swannyās (and asmuts) code as instructed here and in the FAQ, turned OAuth on for the app, and published it to myself.
- In the IDE I created a new Device Handler from the published code.
- In the ST iOS app (Iāve tried both the Classic and new apps) I add the newly created WST smart app. I can see it in my list of smart apps (on the phone), then tap on it. It asks me for my WST login credentials, then seems to log in fine (it says Iām connected). I grant access, say OK and it says my WST account is connected to ST. Great. Then in the next step it asks me which WST devices I want to add. It lists my three devices and Iāve tried selecting all three, or just one. When I tap Done to go to the next step, I get and error: āSomething went wrongā¦ā in the New ST app, or āAn unexpected error occurredā in the classic app. Iāve tried deleting and recreating the smart app in the IDE, killing the iOS app and restarting it - to no avail.
Iām wondering if my mistake has to do with getting the device handler associated with my actual tags. In the FAQ under Using a Custom Device Handler it says I should already have the devices added into my ST account. But how do I add them? When I try to add a device in the iOS app, the tags donāt show up after a scan (in either the new or classic apps). And I canāt add them manually because WSTs arenāt in the list. The community FAQ suggests, for devices that donāt show up in a scan, creating a dummy device in the IDE, assigning it a unique Device ID, then assigning the WST handler to it. I tried that, but how does that actually get associated with one of my WSTs?
Iām missing something here, and probably a few brain cells. Help appreciated!
4/20/20 Update
In case anyone runs into a similar issue, I checked the error log in the IDE. Turns out it couldnāt find the motion DH. I hadnāt installed it because I donāt have any WST motion sensors. I installed that DH, and now all if fine.
Hello Swanny. Are you still available for questions about your Wireless Tag Integration with SmartThings? Iāve attempted to use your code but there seems to be a couple of errors within the code and it will not allow me to continue past the first part of your instructions. Thank you!!! - Bill
I just completed the install. Seems to be working like a charm! 
One adjustment would be great; it shows the tag as a door sensor. If it would show as a temp sensor, it would be perfect.
Anyone with ideas on how to change the code to support that?
I setup the SmartApp and tried to connect it inside Smartthings, including choosing which sensors I want to include, but at the end after clicking ādoneā it gives me a message saying āWeāre having trouble connecting. Check your network connection and try again.ā I retried a couple times and no change.
However back in the main page of Smartthings I can see my sensors showing up and it shows most of the readings like vibration, battery, temperature, humidity, and whatever else built into the sensor.
The problem is when I arm a motion detector I start getting emails from wirelesstag.net saying āCould not call URL for āmotion detector 1ā at event motion_detected due to following errorā Then it lists a long callback URL to smartthings and shows a 500 internal server error.
When pulling up that URL from the email I see this in the browser.
{"error":true,"type":"java.lang.NumberFormatException","message":"An unexpected error occurred."}
WirelessTag tech support said a 500 error means itās not their problem. Has anyone else seen this problem or know how to troubleshoot it?
How do you prevent the Wireless Tags for arming constantly? I have the SmartThings Smartapp installed and working, but I do not want the tag to be armed at all hours. I need it to use the same time schedule that I have already set up in the Wireless Tag IOS app.
A question for this crowdā¦
On the strength of what I have read here, I went ahead and purchased a wireless sensor tag Hub and two moisture sensors. I installed the Hub and the moisture sensors and they came up and started running almost immediately. I then installed swannyās DH for the moisture sensor and the motion sensor, and then installed the smartapp.
Once again everything came up great and seems to be working perfectly.
My question however is about the dataā¦
In the wireless sensor tag app, it shows the moisture sensor is reporting a wet-dry status as well as a moisture percentage. In the smart app on SmartThings, however, the moisture number shows up as humidity. I was going to change the tile in the smart app to say moisture rather than humidity, but before I did I want to make sure that is the right thing to do.
This is in the new SmartThings app, not the classic app, so if I change the tile label in the code to read moisture will that show up properly in the smart app? Also I want to make sure that what is being reported really is moisture and not humidity to SmartThings.
Has anyone had experience with this?
Also, a hat tip to @asmuts - thanks for picking this DH code up when the original author stopped working on it. WST should reach out to ST to do an integration, they are really nice products.
Iāve used this great code for a few years. It worked great. It was added in the classic app then was migrated to the new app by ST. It stopped reading temperatures a couple of months ago. After a few attempts to get it working, I uninstalled the smart app and device drivers. Re-added them using the code from ASMUTS. No errors in the logs, but the new smart app will not show up as an automation on the iPhone app.
Does anyone have an idea on what I might try to get it into the app?
Thanks in advance!
