HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: nobody on March 14, 2016, 08:01:53 AM
-
Hi All!
So, I wrote a script (C#) which communicate with the serial port. I created an virtual module for that, basic sensor type. It has a few parameter and these parameters can be write and read with:
module = Modules.InDomain("HomeAutomation.Smthng").WithAddress("0").Get();
module.Parameter("sensor.Temperature").Value = "25"; // write
param = module.Parameter("sensor.Temperature").Value; //read
It is working fine, but when I'm trying to use this parameter from another (Python) script I always get error.
Here is my code in python:
module = hg.Modules.InDomain("HomeAutomation.python").WithAddress("0").Get()
param = hg.module.Parameter("sensor.Temperature").Value
Error: Scripting host has no attribute 'module'
The other script running and I can see the module.
Is it even possible to do this? If it is, then what am I doing wrong?
Thanks for Your help! :)
-
I don't know python for HG, but it looks like it doesn't like how you are using the "module" variable that holds your HG module. Perhaps you need to call it in a different way?
-
module = hg.Modules.InDomain("HomeAutomation.python").WithAddress("0").Get()
param = module.Parameter("sensor.Temperature").Value
??
-
That would have been my guess, but without having looked at Python for HG, I'd likely have sent the OP in the wrong direction.