Script execution problem after a few hours.

Moderator: leecollings

Post Reply
tuspam
Posts: 37
Joined: Friday 25 December 2015 0:19
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Script execution problem after a few hours.

Post by tuspam »

After some time my domoticz (latest beta) got some problems with the execute scripts in web interface, for example my virtual switch for turn on light looks like that:

Code: Select all

On Action:
script:///home/pi/domoticz/scripts/python/playcode2.py /home/pi/domoticz/scripts/python/lightOffice.txt
When i press virtual switch in domoticz log i see:
2016-12-11 12:56:15.310 User: Admin initiated a switch command (327/Light Office/On)


But nothing happen :(

When i give command in console:

root@raspberrypi:/# home/pi/domoticz/scripts/python/playcode2.py /home/pi/domoticz/scripts/python/lightOffice.txt
Connecting to Broadlink device....
Connected....
Code Sent....

Everything works

What's going on?

PS. After the reboot, everything works a few hours.

playcode2.py

Code: Select all

#!/usr/bin/python

import broadlink
import time
import sys

try:
    fileName = sys.argv[1]
except IndexError:
    fileName = 'null'

if fileName == 'null':
   print "Error - no file name parameter suffixed"
   sys.exit()
else:

   device = broadlink.rm(host=("192.168.001.104",80), mac=bytearray.fromhex("B4430DF09A86"))

print "Connecting to Broadlink device...."
device.auth()
time.sleep(2)
print "Connected...."
#time.sleep(1)
device.host

file = open(fileName, 'r')

myhex = file.read()

device.send_data(myhex.decode('hex'))
print "Code Sent...."
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests