# Exec 2.0 : Updated : new functionalities to address your concerns

**URL:** <https://community.openhab.org/t/exec-2-0-updated-new-functionalities-to-address-your-concerns/20146>\
**Category:** Bindings\
**Created:** [January 12, 2017, 8:58pm UTC](https://community.openhab.org/t/exec-2-0-updated-new-functionalities-to-address-your-concerns/20146 "2017-01-12T20:58:01Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Paul\_Atkin](https://community.openhab.org/user_avatar/community.openhab.org/paul_atkin/32/42987_2.png) [@Paul\_Atkin](https://community.openhab.org/u/Paul_Atkin)\
**Post date:** [February 6, 2017, 3:12pm UTC](https://community.openhab.org/t/exec-2-0-updated-new-functionalities-to-address-your-concerns/20146/8 "2017-02-06T15:12:08Z")

</div>

ok, it is quite ugly but it works.

Thing exec:command:pluglight [command=“/opt/openhab2/conf/scripts/hs100.sh 192.168.10.42 9999 %2$s”, interval=0, timeout=5, autorun=true]  
Thing exec:command:pluglightcheck [command=“/opt/openhab2/conf/scripts/hs100.sh 192.168.10.42 9999 check”, interval=1, timeout=5]

Switch Pluggy “Lamp One” (FF\_Lights, FF\_Lights1, FF\_Lights2, Lights) [“Switchable”]  
(this switch is what you put into sitemap and into all groups)

String PlugOne {channel=“exec:command:pluglight:input”, channel=“exec:command:pluglightcheck:output”,autoupdate=“false”}

String PlugOneState “Plug One Status” {channel=“exec:command:pluglightcheck:output”}

(strings to communicate with the HS100)

and rules  
rule “Plug One 1”  
when  
Item Pluggy changed from ON to OFF  
then  
// if ((Sensor2Lum.state\<50) {  
postUpdate(PlugOneState,“OFF”)  
sendCommand(PlugOne,“OFF”)  
logInfo(“Network”, "Switching Pluggy Off: "+PlugOneState.state )  
// }  
end

rule “Plug One 2”  
when  
Item Pluggy changed from OFF to ON  
then  
logInfo(“Network”, "Switching Pluggy On: "+PlugOneState.state )  
// if (Sensor2Lum.state\<50) {  
postUpdate(PlugOneState,“ON”)  
sendCommand(PlugOne,“ON”)  
logInfo(“Network”, "Switched Pluggy On: "+PlugOneState.state )  
// }

end

rule “Plug One 3”  
when  
Item PlugOneState changed from OFF to ON  
then  
logInfo(“Network”, "Switching Pluggy On: "+PlugOneState.state )  
// if (Sensor2Lum.state\<50) {  
postUpdate(Pluggy,“ON”)  
sendCommand(PlugOne,“ON”)  
logInfo(“Network”, "Switched Pluggy On: "+PlugOneState.state )  
// }

end

rule “Plug One 3”  
when  
Item PlugOneState changed from ON to OFF  
then  
logInfo(“Network”, "Switching Pluggy On: "+PlugOneState.state )  
// if (Sensor2Lum.state\<50) {  
postUpdate(Pluggy,“OFF”)  
sendCommand(PlugOne,“OFF”)  
logInfo(“Network”, "Switched Pluggy On: "+PlugOneState.state )  
// }

end

---

_[View the full topic](https://community.openhab.org/t/exec-2-0-updated-new-functionalities-to-address-your-concerns/20146)._
