How do I make a sensor writable?

Posted on
Mon Oct 01, 2018 12:41 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

How do I make a sensor writable?

I'm working on my custom Indigo plug-in to toggle a 12V relay hooked up to an Arduino via ethernet. A simple HTTP GET with parameters passed will set the relay, which will turn on or off the siren.

I'd like to use the "Sensor Controls" for my "Siren" device, but the options to turn off/turn on are greyed out.

Screen Shot 2018-10-01 at 1.38.41 PM.png
Screen Shot 2018-10-01 at 1.38.41 PM.png (7.51 KiB) Viewed 988 times


I suspect the way to specify an action to perform the Turn Off/Turn On and Send Status Request operations are in the Devices.xml file, but I am unaware of how to extend it to "do something." Is there an example someone could point me to which demonstrates how to go from a read-only device to a read-write device?

Posted on
Mon Oct 01, 2018 1:42 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

Re: How do I make a sensor writable?

UPDATE: I found actionControlGeneral in plugin.py and added code to update the value of the device when "Send Status Request" is clicked. That's working now.

I also see actionControlSensor, but I suspect there's some tag I need to add somewhere to indicate that my particular type of device is read/write?

Posted on
Mon Oct 01, 2018 1:43 pm
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: How do I make a sensor writable?

Take a look at the Indigo Plugin SDK

It looks like the Example Device - Sensor.indigoPlugin example shows how it is done. :)

Posted on
Mon Oct 01, 2018 1:50 pm
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: How do I make a sensor writable?

Corrected the link in the post above to the Indigo 7 version of the SDK. :oops:

Posted on
Mon Oct 01, 2018 2:37 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

Re: How do I make a sensor writable?

Yeah! Thanks Jon. Things are working now :D

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests