New smart app to link the virtual/simulated garage door device with two actual devices

No this code is a smartapp you add under smartapps. the existing code you copy and edit under device type code.

Uhmā€¦yea.

First time adding a smartapp/virtual device here.
I understand that the code you provided is a smartapp and that I need to add it. But, there are three options when I go to add a smartapp (Form, Code, Template).
This time around, instead of Template, I added the code using the ā€œCodeā€ option. This seems to have behaved more like what I expected. I can see where various fields have auto-populated when I go into ā€˜Editā€™ mode on this new custom smartapp. So it looks like maybe that was the correct way to do it. Yes?

So next, Iā€™m lost. I do see the new device I created as a THING on my ST phone app (using the name for the virtual device) but I donā€™t see a way to edit its code.
The new THING does show that the door is closed. Havenā€™t tested it yet to see if it works (after hours).

Sorry for the annoying newb questions. Still learning.

Hey @ck42 so after you add the new smart app for the garage door and you publish it so you can add it in your app. The next step is to create the virtual device. There shouldnā€™t really be anything you need to change in the code itself. Just create the device and donā€™t forget to give it a unique device id i.e. VGD01.

Once you have that done go into the app. Go to the add button on the bottom right and then select the smart apps at the top.
Then click my smart apps and select the garage door one.
Fill out the form with the required information for the virtual door, then the door sensor and the door controller. Let me know if Iā€™m being too vague with this. Thanks.

Thanks Lgkahn, that got me working.

1 Like

Thinking that maybe I do NOT have the virtual device created (or created properly).
Looking at these steps here, it instructs me to use the Template option

Go into my device types in the ide,

select new device type
select from template
select the simulated garage door device in the list
make your changes to the codeā€¦ recommend you also change the name so you can tell the difference from the stock one.
go to my devices in the ide
select your virtual or simulated door device
select edit
in the device type pulldown change it to your own custom device type you setup earlier with the change ( it will be in the bottom of the list)
save changes
retest

But, when I first tried using this option, I got the NPE.
But even after that part, Iā€™m not clear what I do. I select the simulated Garage Door Opener device, but what then? ā€œMake your changes to the codeā€ ???

ā€¦man, anyone have a video for this? LOL.

I didnā€™t make any changes to the code, so Iā€™d just ignore that tidbit for now.

Yeah, just realized that those steps were in regards to changing the Simulatated garage door ā€œTemplateā€ (6 sec down to 1 sec value)
So if Iā€™m not mistaken, thereā€™s the simulated door ā€œtemplateā€ and thereā€™s the actual smartapp ā€˜codeā€™.
It seems that BOTH are used. The Template just being a framework for the simulated door deviceā€¦and the code being the actual functional part. Both combined complete the custom smartapp. Sound right?

So I see now in THINGS:
Garage Door sensor (open/close sensor)
Garage Relay (LFM-20 relay)
Virtual Garage Door Opener

The relay and sensor are verified to be working (using original ST garage door app)

In the IDE, I see the smartapp here that I added. and itā€™s published. But, I donā€™t see this smartapp listed on my phone in the smartapps section. Shouldnā€™t I? Tried re-publishing it again. No change.

When I select the Virtual Garage Door opener THING, I see the app icons and I can select to open and close, and icons change color and all. But, the door never actually opens/closes.

In your phone go to the add new button in the lower right hand corner. Click the smart apps tab at the top. Then scroll down to the bottom where it says my smart apps (this is where anything that was published goes) Click the garage door app and fill out the values with your devices.

Got it. Getting closer now. Smartapp now displayed and filled out the different settings.
Now, selecting the Virtual garage door THING, it acts same as before. Pretends to be opening and closing but nothing really happens.

show the logging under the ide when you open the door with the old non virtual door openerā€¦

than show the screenshots in the app where you have configured thingsā€¦ something is not configured right,
also show the logs when you try opening with the virtual device not the physicalā€¦ you may have to open and close a couple times manually to get them in syncā€¦ also show the logs for that.

When using the virtual door opener, NOTHING is logged at all.

Used the old original opening THING to open the door:
19639e1d-12b1-4af3-bb94-e889b84553f7 8:13:03 PM: debug Garage Door Opened Manually syncing with Virtual Garage Door!
19639e1d-12b1-4af3-bb94-e889b84553f7 8:13:03 PM: debug Contact is in open state
19639e1d-12b1-4af3-bb94-e889b84553f7 8:13:03 PM: debug Contact is in open state
8:12:31 PM: info Waiting on eventsā€¦

Change your ā€œChoose the Virtual Garage Door Device Sensor (same as above device)ā€ to be the Virtual-Garage Door Opener and give that a whirl.

Okā€¦did that.
Tried opening again, but no movementā€¦but the logs certainly do give more detail now.

8:15:25 AM: debug Contact is in closed state
8:15:19 AM: debug Resetting Virtual Garage Door to Closed as real door didnā€™t open! (track blocked?)
8:15:19 AM: debug opening virtual door as it didnt openā€¦ track blocked?
8:15:08 AM: debug poll is sending [ā€˜85010201ā€™, ā€˜98810085010101ā€™, ā€˜850202ā€™, ā€˜delay 6000ā€™, ā€˜988100850201ā€™, ā€˜delay 6000ā€™]
8:15:08 AM: debug setting association
8:14:59 AM: debug Virtual Garage Door Opened syncing with Actual Garage Door!
8:14:59 AM: debug opening real gd to correspond with button press
8:14:59 AM: debug Contact is in open state

I think the issue is with the real/physical relay THING. One of the things I noticed about it that annoys me is that I have to press the button in the app twice (not a fluke) for it to actually open or close the door. It doesnā€™t act like a momentary switch like the door opener on the garage wall. I think this smartapp is sending the signal equivalent of me just pressing the button onceā€¦which wonā€™t work.

Come on people I stated your existing setup has to WORK pushing the button twice is not working. You have a switchā€¦ the opener expects a momentary switch. Change the existing device type to momentary contact or add a rule in.lights and switches that turns it off immediately when it sees it on. Again.make sure your setup works before modifying it.

Thanks for the help, Larry/Jason
Got it all working now. Had to change the relay device type to Z-Wave Virtual Momentary Contact Switch.
Edited the code to get rid of that 6sec delay and everything works beautifully now.
Interesting first experience with all of this.

3 Likes

Good job it gets easier in the future ā€¦ at first it is a bit to wrap your head around if you donā€™t have a software background.

Has anyone else had problems since the system update on Tuesday? I had a working setup prior and now when I try to open the door it moves maybe 1/2 inch then stops. Checking the device type it is still set to a virtual momentary contact. Not sure what happened.

yes I had problems today since the last round of changes things in the cloud are running slower and the sensor is not sending the update that the door is open or closed quick enough ā€¦ I had to add 5 more secs to my timeout

I installed and configured the Virtual Garage Door and it was working for several weeks without a problem. Thanks Lgkahn. A few days ago it seems to be out of sync and I cannot get it to sync again. Here is a screen capture. The yellow part is not sensitive to touch now. I can open and close the garage door with the relay or manually with the normal garage door opener.
Any suggestions? Thanks
BTW, my hardware is a LFM-20 relay and a SmartSense Multi Sensor.

Go to the actual device that is one level above it and check the logs. Also increase the timout my guess is it is running slow. Finally manually via wall.switch open.and close the Door a couple if times to get them back in sync.