Page 1 of 1

Python Plugin

Posted: Monday 11 December 2017 13:26
by imcfarla
I am having problems setting the TimedOut property on a device.

Error:

Code: Select all

2017-12-11 12:12:43.817 Error: (CDevice_update) Hive - Bedroom: Failed to parse parameters: 'nValue', 'sValue', 'SignalLevel', 'BatteryLevel' or 'Options' expected.
2017-12-11 12:12:43.817 Error: (Hive) 'CDevice_update' failed 'TypeError':''TimedOut' is an invalid keyword argument for this function'. 
Note the 2 single quotes before TimedOut above which may be relevant.

My code is

Code: Select all

Devices[unit].Update(nValue=Devices[unit].nValue, sValue=Devices[unit].sValue, TimedOut=1)
but this also happens when doing something like

Code: Select all

Devices[unit].Update(nValue=0, sValue='Off', TimedOut=0)
I am running the v3.8153 build from the website

Any ideas?

Re: Python Plugin

Posted: Monday 11 December 2017 13:35
by Logread
@imcfaria,

The device timedout option is a recent addition to the plugin framework. You need to run a very recent beta.

Re: Python Plugin

Posted: Monday 11 December 2017 17:41
by imcfarla
In which case is there anyway to get the version of domoticz from the python plugin interface?

Re: Python Plugin

Posted: Tuesday 12 December 2017 7:42
by Logread
imcfarla wrote: Monday 11 December 2017 17:41 In which case is there anyway to get the version of domoticz from the python plugin interface?
I am not sure this is exposed to plugins natively. I'd suggest to make an http call to the json API such as /json.htm?type=command&param=getversion
This will return a json object like this:

Code: Select all

{
   "DomoticzUpdateURL" : "http://www.domoticz.com/download.php?channel=beta&type=release&system=linux&machine=armv7l",
   "HaveUpdate" : false,
   "Revision" : 8775,
   "SystemName" : "linux",
   "build_time" : "2017-11-06 12:49:07",
   "dzvents_version" : "2.3.0",
   "hash" : "283e647d",
   "status" : "OK",
   "title" : "GetVersion",
   "version" : "3.8702"
}
from which you can extract the version.

Re: Python Plugin

Posted: Friday 15 December 2017 17:21
by imcfarla
What is the difference between the Revision field and the version field?

Code: Select all

DomoticzUpdateURL	"http://www.domoticz.com/download.php?channel=stable&type=release&system=linux&machine=armv7l"
HaveUpdate	false
Revision	8153
SystemName	"linux"
build_time	"2017-12-15 12:30:19"
dzvents_version	"2.3.0"
hash	"0db2a6e1"
status	"OK"
title	"GetVersion"
version	"3.8788"

Re: Python Plugin

Posted: Sunday 17 December 2017 1:35
by Dnpwwo
@imcfarla,

I added "DomoticzVersion", "DomoticzHash", "DomoticzBuildTime" entries to the Parameters dictionary today.

Should be in a beta soon.

Re: Python Plugin

Posted: Sunday 17 December 2017 8:36
by imcfarla
Cheers