Variable to check for garage door position on GD00Z-5

I’m replacing my garage door open/close sensors with GD00Z-5 garage controllers. I have several Luup scripts that check the open/close status of the sensors, but I don’t know how to get the status using the GD00Z-5 controllers. Can anyone enlighten me?

Thanks, Geoff

The open/closed status variable is called… Status (urn:upnp-org:serviceId:SwitchPower1)

Thanks! Just to make sure for myself and future readers, the code would read like:

 if (luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",gd2_dID) == "1") then
    do_something_here
 end

– Geoff

Just FYI, I wrapped your code in ``` (three backticks on a line by themselves before and after the code) to preserve formatting. Otherwise, when people copy-paste, there’s a high probability the quotes will get broken and translate into “pretty” but not code-compatible quotes.

Thanks for wrapping the code, as the pretty quote marks caught me. I had cut & pasted the above code (before you wrapped it) into my code and it took quite a while to figure out what was broken. It wasn’t until I pasted the code into a different editor with different fonts that it was clear that they were the wrong quote marks.

Why a forum that deals with code has a feature that converts quote marks into pretty quote marks is beyond me. I’m not a regular in this forum and didn’t know about the back-ticks. Can’t you disable this pretty quote feature?

It’s not just the forum. The apps on phones and desktops often want to do it, too, especially Apple/Mac devices where typography has always been a big deal. Some people will unwittingly use Word to hold text fragments–boom! Corrupted. But even apps like Evernote can do it. I’m not sure if this forum software can disable those translations, but I know that using the formatting codes works a treat, and it makes it look better/more readable besides–even if it could be disabled, code would still look terrible formatted in this default font.