VB Script & GetPropertyValue

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
robobbi
Member
Posts: 12
Joined: Thu Jan 08, 2009 7:16 pm
Location: Italy

VB Script & GetPropertyValue

Post by robobbi »

Hello,
I need your help for the following issue.
I tried to use a generic unique vb script triggered by the "On" status change for some "X10 Transmitter" devices, according to the GetPropertyValue feature "the Device Name can be omitted if the Property specified belongs to the Script Device that is running the currently executing script".
But using eg. the function GetPropertyValue(".Power State") the code/value returned is "* error *" (Unable to find Device with Description [* error *]) :( .
Is it due to my misunderstanding? :?
Any kind of suggestion would be very appreciated.
Thanks a lot.
ScottBot
Site Admin
Posts: 2806
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: VB Script & GetPropertyValue

Post by ScottBot »

Is your script running as part of an actual 'Script' Device, or are you executing it from a Task? This feature will only work when being executed as part of a script Device.
Scott
robobbi
Member
Posts: 12
Joined: Thu Jan 08, 2009 7:16 pm
Location: Italy

Re: VB Script & GetPropertyValue

Post by robobbi »

Thanks, that's quite clear now and I confirm the script was activated by a task :? .
Anyway, just Implemented a workaround: created a generic script device with a custom "DeviceName" property (alpha type) valued by the dedicated task (triggered on change of the "Power State" property's of the X10 device managed by the RFXCOM interface) before setting the "State" property up to "Running" for executing the generic original vb script. The generic vb script simply reads (GetPropertyValue) the ".DeviceName" and uses it to access all the properties of the interested trasmitting X10 device (eg. P8.property_name).
it seems to work ... but not really confident on its reliability in case of concurrent triggerings on more X10 devices.
Thanks once again for support.
Post Reply