There are two parts in setting up control of an external light using IAdea PIO-101 GPIO extender:
1. Hardware ꟷ Connect GPIO extender to a relay.
2. Software ꟷ Program output signal to control the relay.
Connect GPIO extender to a relay.
1. Relay. (JQC-3FF-S-Z Relay as example)
2. IAdea PIO-101 GPIO extender.
Programming to send output signal to control relay
When the IAdea GPIO extender sends out the programmed output signal, the relay is sent through the power line that connects the GPIO extender to the connected light and will turn the light on. To turn the light off, disable output signals from the GPIO extender.
There are two ways to control output signal from the GPIO extender.
Use adapi:lightControl to control GPO output.
The name in param is GPn, the n can be 0~3.
<ref src="adapi:lightControl" >
<param name="GPO0" value="on"/>
For more information about SMIL, find A-SMIL.
Attached is the sample SMIL code for GPO. The SMIL turns the light off by setting GPO off for 5 seconds and then, turns the light on by setting GPO on for 10 seconds in an indefinite loop.
Use REST-API hardware/light to control GPO. http://www.a-smil.org/index.php/REST_Push_API#POST_hardware.2Flight
The name in parameter is GPn, the n can be 0~3.
For more information about REST API, find REST API tutorial.
Please sign in to leave a comment.