HomeGenie Forum
General Category => Troubleshooting and Support => Topic started by: ftsikogi on May 20, 2015, 10:19:26 AM
-
i am a newbie so please be patient. I have installed HG on an Intel Nuc running Windows 8 the last 2 days and it is running fine until now. I am currently testing the software. I have some questions though that i would like some help
1. I have one fibaro universal sensor (FGB321) with a temperature sensor attached. This is a multichannel device. HG shows the master device and the temperature info. What i cannot figure out is how can I create the other 2 virtual devices that this sensor has (Input1, Input2)
2. I am not aware of C# scrpting language but i would like to do the following. Create a script that will be triggered by a motion sensor and if it is tripped then a snapshot image from my Foscam IP camera will be sent to an email address.
3. Create a simple C# script that turns on a device, wait for some seconds and then turns off
Thank you
Filippos
-
You can look at the C# program Automation and Programs/ZWave/FibaroRGBW module that I wrote for RGBW multiinstance dimmer for handle the virtual modules.
And look at Automation and Programs/ZWave/Multi/Instance Channel Virtual Modules for create the 2 virtual sensor modules you need.
When you activate I1 and I2 do you receive any ZWave messages, In Logging event Console ?
Cheers
Dani
-
For #2, just playing, sent image from an open webcam to text message with:
byte[] img = Net.WebService("http://cdn.abclocal.go.com/three/wls/webcam/Loopscape.jpg").GetBytes();
Net.AddAttachment( "", img )
.SendMessage( "[email protected]", "", "HG: Motion Detected!" );
This could go into the "Security Alarm System" in the main program loop where the SendMessage already exists.
Not having any luck so far with my camera embedding the username and password into URL:
byte[] img = Net.WebService("http://username:[email protected]:8080/shot.jpg").GetBytes();
I use an old android phone with IP Webcam app, the URL with username/password seems to work from chrome browser.
-
1. I have one fibaro universal sensor (FGB321) with a temperature sensor attached. This is a multichannel device. HG shows the master device and the temperature info. What i cannot figure out is how can I create the other 2 virtual devices that this sensor has (Input1, Input2)
Did you have in "configure" -> "automation" -> "Z-Wave", the program "Multi Instance/Channel Virtual Modules" activated ?
2. I am not aware of C# scrpting language but i would like to do the following. Create a script that will be triggered by a motion sensor and if it is tripped then a snapshot image from my Foscam IP camera will be sent to an email address.
mvdarend already create a C# script to arm/disarm a foscam camera :
http://www.homegenie.it/forum/index.php?topic=430.msg2435#msg2435 (http://www.homegenie.it/forum/index.php?topic=430.msg2435#msg2435)
Perhaps, it can be a good solution, or you can use the code to your target ...
3. Create a simple C# script that turns on a device, wait for some seconds and then turns off
That can be very easy :
- Trigger code :
return true; - Program code :
Modules.WithName("xxxxxxxxxx").On();
Pause(10); // for 10 secondes
Modules.WithName("xxxxxxxxxx").Off();
Pause(10); // for 10 secondes
-
To send an email attachment with an image, you can use :
var imageData = Net.WebService("url_of_image").GetBytes();
Net.AddAttachment("camera.jpg", imageData).SendMessage("dest_email", "subject", "mail_text");
http://www.homegenie.it/docs/doxy/a00006.html#afdc4d82ab17b6fadc3ad3a2cfa8ed70b (http://www.homegenie.it/docs/doxy/a00006.html#afdc4d82ab17b6fadc3ad3a2cfa8ed70b)
http://www.homegenie.it/docs/doxy/a00006.html#a5da7a367ad63b4ce435a5fd52d11cb75 (http://www.homegenie.it/docs/doxy/a00006.html#a5da7a367ad63b4ce435a5fd52d11cb75)
Cheers,
g.
-
You can look at the C# program Automation and Programs/ZWave/FibaroRGBW module that I wrote for RGBW multiinstance dimmer for handle the virtual modules.
And look at Automation and Programs/ZWave/Multi/Instance Channel Virtual Modules for create the 2 virtual sensor modules you need.
When you activate I1 and I2 do you receive any ZWave messages, In Logging event Console ?
Cheers
Dani
I have both programs "Fibaro RGBW & Multi/Instance Channel Virtual Modules" enabled and when I1 or I2 are activated i do get events in the console. Still though i do not know how to add the 2 virtual devices for I1 & I2.
Thanks
-
Thank you all for your valuable help until now. Just to add that i have managed to send a snapshot image as an attachment from my foscam camera (FI8918W) using the script below:
byte[] img = Net.WebService("http://IPcamera:81/snapshot.cgi?user={username}&pwd={password}&count=0").GetBytes();
Net.AddAttachment( "", img )
.SendMessage( "email address", "", "HG: Motion Detected!" );