Help with changing a device handler

Im trying to take a handler from a example and change a few things. So I thought if I just make changes I could then add it to my handlers and use it. But when I try saving it I get this message

Org.springframework.security.access.AccessDeniedException: Run Locally Permission not allowed for DeviceType: bcc90d0f-217e-4f7a-8617-5df0ba4c0b0e

I just want to change it so it shows open and closed and not on or off.

Im new and not having any luck learning this.

Hi @rhconcepts,

Look for this bit of code in the metadata section:

runLocally: true

Change true to false.

Which DTH are you using as an example?

Im using the SmartPower Outlet as my example

Cool. Change line 18. What are you trying to do, out of curiosity?

I want the switch to show open and close on the app and not on or off. I got it but I messed the code up because now it shows OPEN but I cant close it lol. I found a way to make the switch open my garage door using a 12v power supply and a 12v relay. And in the app I set up the power allowance to turn the switch off after 0 mins. So when I turn it on it turns right off but its enough time to trigger the relay.

1 Like

Thank you John, I changed it so the switch shows open/close on my app :slight_smile: and now I know how to publish them when I get that error.

I would love to make the switch turn off after I turn it on without adding that power allowance rule. Any pointers on that part?

Thanks for the help

You could get pretty creative with device handlers, but I’ve not done anything like that except through SmartApps. I prefer to keep DTH’s relatively straight forward for using the device, and then apps to manipulate them based on rules or conditions.

runIn 30 (off)
30 sec. Off command

Put it near the end of the command you want the timer to start. You could get fancy and have the time as a preference which could be changed in the app

1 Like

Thanks Mark but I have no clue what line it would be added to and would it look like this runIn 30 (off) ?

runIn (30, off) it would need to go near the end of the ‘def on()’ command