It seem to be working now i updated the code.
BlackBeanControl.ini
[General]
IPAddress = 192.168.38.171
Port = 80
MACAddress = c8:f7:42:16:b3:c6
Timeout = 10
[Commands]
AirconON = 2600d8000001279411381136131312130f1510141237113811381138113911131113121211381113111410141014111312121138113812371213111311131113111311141014101411131113121211131312103910141237111311131113111410141113111311131113121310141014111312371212111311141212111311131212111311131114101411131212111311131113111410141113111311131113111312381014101411131113111311141014101411131212113811131139101411131113111312121138113910391137121311131138113911000d05
AirconOFF = 2600d800000127941237123811131113121211131138123810391039113811131114101410391014111311131113111312131039103911381113121212121213101411131113111311131114111310141113113811131237111411131014111311131113121211141014111311131212111410381114101411131113111312121114101410141212121211131113111410141113111311131212121212131014101411131113121211141113101411131212111410131114103910141138111411121113121310141138113811381138111410391113113812000d05
ir.things
Thing exec:command:remote-send [command="/usr/bin/python /usr/share/openhab2/exec/BlackBeanControl/BlackBeanControl.py -c %2$s", interval=0, timeout=5, autorun=true]
ir.items
Switch LVAircon <"player"> [ "Switchable" ]
Switch Remote_Send { channel="exec:command:remote-send:run" }
String Remote_Send_Args { channel="exec:command:remote-send:input" }
String Remote_Send_Out { channel="exec:command:remote-send:output" }
ir.rules
rule "Aircon"
when
Item LVAircon received command
then
//while(Remote_Send.state == ON){
//Thread::sleep(500)
//}
//if(LVAircon.state == ON){
if(receivedCommand == ON){
Remote_Send_Args.sendCommand("AirconON")
}else{
Remote_Send_Args.sendCommand("AirconOFF")
}
// wait for the command to complete
while(Remote_Send.state != ON){
Thread::sleep(100)
}
Thread::sleep(400)
logInfo("Aircon", "Resuts are: \n" + Remote_Send_Out.state )
end
home.sitemap
Frame label="Remote Control"
{
Text label="Aircon" icon="climate-off"
{
Switch item=LVAircon label="Aircon"
}
}
This is the python scripts im using: