I have a bash script which can be used to control the airco units. This script van also be used to get the status of the units.
Code: Select all
./airco.sh 192.168.0.60 set power on
./airco.sh 192.168.0.60 set speed 2
./airco.sh 192.168.0.60 set mode cool
etc.
Code: Select all
pi@pidomoticz:~ $ /home/pi/airco.sh 192.168.0.60 get speed
4
pi@pidomoticz:~ $ ./airco.sh 192.168.0.60 get power
1
pi@pidomoticz:~ $ ./airco.sh 192.168.0.60 get speed
4
pi@pidomoticz:~ $ ./airco.sh 192.168.0.60 get mode
4
pi@pidomoticz:~ $ ./airco.sh 192.168.0.60 get vane
10
pi@pidomoticz:~ $ ./airco.sh 192.168.0.60 get setpoint
220
etc.
The Lua script I use:
Code: Select all
commandArray = {}
print('=========== airco script start ============')
aircoValuePowerSK = os.execute('/home/pi/airco.sh 192.168.0.60 get speed')
commandArray['OpenURL'] = 'http://192.168.0.126:8080/json.htm?type=command¶m=udevice&idx=735&nvalue=1&svalue=' .. aircoValuePowerSK;
print('=========== airco script eind ============')
return commandArray
How can this be fixed?Error: EventSystem: in Airco_status: [string "commandArray = {}..."]:6: attempt to concatenate global 'aircoValuePowerSK' (a boolean value)
In short: I want the status in Domoticz to reflect the status also when I use the IR controller or the iPhone app. So, the corresponding value must be read (get) and then sent to the virtual switch in Domoticz.
I hope someone can help me out.