DanielOgorchock / ST_Anything

ST_Anything is an Arduino library, sketch, and Device Type that works with your SmartThings ThingShield to create an all-in-one SmartThings device.
GNU General Public License v3.0
438 stars 448 forks source link

Child Ultrasonic does not display correctly in new ST mobile app #239

Closed aalsup closed 3 years ago

aalsup commented 3 years ago

The child ultrasonic sensor appears to be working (based on the live logs); however, the mobile UI only shows Status: Connected. The other tiles defined in the DTH are not displayed at all. I'm guessing this is due to the new Custom Capabilities change in ST.

I'm new to ST_Anything but would be happy to help out. Please let me know if/how I can help.

aalsup commented 3 years ago

I have created a branch in my forked repo to get things working in the new ST mobile app.

https://github.com/aalsup/ST_Anything/tree/new_st_app

I would like to submit a PR, but I don't want to create confusion if there are already too many cooks in the kitchen.

Anyway, to test things out, I started with new configs for the parent-st-anything-ethernet and child-ultrasonic-sensor devices. They work fine in the new ST mobile app. If this approach seems sound, then it's worth continuing. All generated content is available in the branch.

I've also included some helpful commands and link in devicetypes/ogiewon/st-capabilities/README.md.

Let me know if you'd like to collaborate

ogiewon commented 3 years ago

Looks like you’ve done the hard work of figuring out the proper way to integrate custom DTHs with the ‘New’ ST App. Congratulations and thank you! It’ll be a little while before I can fully test your changes, but I definitely will. Hang tight and I’ll reply here with my findings.

I am personally not using SmartThings for any ‘production’ home automation activities. I use Hubitat as my primary solution. I still try to do what I can to support the original ST_Anything users on the ST platform...however Samsung is making that more and more difficult. 😉

ogiewon commented 3 years ago

@aalsup - I was able to test your new Parent Ethernet DTH this afternoon. Nicely done! Thank you for figuring out the new way of building a custom DTH for the new ST App. Nice to have RSSI and Refresh back! I have incorporated all of your changes for both the Parent and the Ultrasonic DTHs into my ST_Anything Github repo. This will save you the trouble of having to create a PR. I made sure to credit you in the comment section of the Parent DTH. You had already added yourself to the comments of the Ultrasonic DTH.

Again, thank you very much!

ogiewon commented 3 years ago

One more thing... I really don't see the value in the custom "LastUpdated" attribute. I have removed it from all other child DTH's, as I was able to get all of the rest of them working fine with the New ST App already. The Parent's 'Presence' attribute should be used to signal the user whether or not their ST_Anything microcontroller is sending data, or not. Thus I believe the LastUpdated custom attribute is redundant, and unnecessarily adds extra workload to the ST Cloud servers for very little gain. I left the Child Ultrasonic DTH exactly as you wrote, since the previous version was 100% broken with the new ST App already. Your call if you want to submit a PR to remove the LastUpdated custom attribute or not.

CRedsand2 commented 3 years ago

i had my door and window sensors working PERFECTLY following all Daniel's code/repositories/instructions

with new ST app... what are the proper steps to follow to make all contact sensors show correctly in new App (all my contact sensors are there but show offline) - the annoying part is when I login to IDE they all show active and display current true statuses

ogiewon commented 3 years ago

@CRedsand2 - Unfortunately, the 'fix' is not super quick, but it is very functional afterwards... The first thing to do is to update all of your ST_Anything DTHs in the ST Web IDE. Using the GitHub integration, this is pretty simple. Just be sure to click the PUBLISH checkbox in the bottom right corner BEFORE you update the DTHs. Next, you should be able to close and relaunch the ST Mobile App, which should hopefully now pick up the new DTH changes. I know the new ST App likes to cache things though, so it may not update correctly. In any event, the next part is the harder part... you must delete each and every ST_Anything child device. This means breaking any automations/apps that they are part of currently. Once the child devices are gone, you can simply press REFRESH on the Parent Device (assuming the new DTH changes took effect) and all of the Child Devices should ne be recreated and will work in the New ST App. You can now add them back to the automations and apps that they used to be part of.

If the Parent Device does not update correctly, it may be simplest to to just delete it, which will also delete all of its child devices. Then simple manually add it again, and reconfigure its settings with the exact same settings from the old parent device.

Have fun!

CRedsand2 commented 3 years ago

Thank you so much! i'm going to try!! I updated all child device handlers manually from your updated code (having a hard time connecting repo) + (I was only using 4 - your Child Alarm, Child Contact Sensor, Child Switch, and Parent_ST_Anything_Ethernet for my arduino setup) the only thing I'm confused of in terms of updating child device handlers is... what do I do with the "st-device-config.json" file in the Parent_ST_Anything_Ethernet.src directory?

Also i'm not that good (i'm trying to do the best I can to learn) for clarification would you mind looking at my screenshot and confirming the highlighted "contact sensors" i have are the child devices I need to delete manually one by one? 1

CRedsand2 commented 3 years ago

Daniel, you are the man!!!!!!! I still don't understand what I need to do with the "st-device-config.json" file in the Parent_ST_Anything_Ethernet.src directory after I updated all the code you created in all of my device handlers... BUT I followed your instructions slowly and carefully (as I was afraid of breaking everything) and all my child devices popped right back in (JUST AS YOU SAID) after I refreshed parent!!! Now i just have to rename everything and make new routines and stuff!!! THANK YOU THANK YOU THANK YOU!!!! keep me posted if you don't mind reaching out...if i'm missing something import with the "st-device-config.json" file in your Parent_ST_Anything_Ethernet.src directory.. THANKS AGAIN!!!!! YOU ARE A LIFE SAVER!!! Screenshot_20210115-114719_SmartThings

ogiewon commented 3 years ago

Ignore the json files. Glad you got it working.

CRedsand2 commented 3 years ago

anything you can think of in code that would prevent contact sensors 10 and 11 from not displaying properly (all single digit contact1-9) are working as expected...I tested the physical connections on my side... let me know if you have any thoughts

CRedsand2 commented 3 years ago

nevermind! removed and re-added again... magically working... does anyone else hate the new app??