more G-Labs products

Author Topic: UpnP Interface not saved  (Read 4066 times)

October 06, 2014, 08:16:19 PM
Read 4066 times

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
Hello all.
What a great project this is. Im really loving it and its the best Ive seen so far. I do have a question and I found something which is a small bug I think.

Windows; when I stop the service via the icon in the lower right corner and then exit.. then start again the UPnP interface is switched off and all modules are not connected anymore.

and.. I read in the information that speech synthesis was implemented, I did a search and I found on Github a document where it is also mentioned. I can't find it in the program, am I missing something or isn't it implemented yet.

Regards and cheers...

October 07, 2014, 04:50:21 AM
Reply #1

RoChess

  • ***
  • Information
  • Full Member
  • Posts: 61
and.. I read in the information that speech synthesis was implemented, I did a search and I found on Github a document where it is also mentioned. I can't find it in the program, am I missing something or isn't it implemented yet.


New to HomeGenie myself, but I did remember reading this on the forum yesterday, and indeed the direct post is here:

http://www.homegenie.it/forum/index.php?topic=372.msg2155#msg2155

So with a little C# scripting you can create the next HAL2000/JARVIS.

October 07, 2014, 10:07:49 AM
Reply #2

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Just a remark. It also works with Javascript/Ruby/Python.

Code: [Select]
hg.Program.Say('Hello World!', 'en-US');

Cheers,
g.

October 07, 2014, 08:22:32 PM
Reply #3

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
Hello, Thank you for the quick replies..

I'm completely new to this and I read about the speech implementation. Im not a real C# programmer and I am figuring out how HomeGenie works. Thanks to RoChess I found this:

.....Now you can start coding :) The easiest thing u can do is to trigger a notification:
Program.Notify("Hello", "World");

Connect the audio to your HomeGenie and let it speak:
Program.Say("Hello, World!", "en-US");


Im sorry if I maybe sound a little stupid but how do I connect audio? In HomeGenie? Physical?

You can turn on modules (leds or lights) by running this code:
Modules.WithName("NameOfYourLight").On();

To test the code, press the "Actions"-button in the lower right corner, and "update". After it has compiled the program u can run it by pressing "Actions", "Run".


Is there a complete tutorial? A youtube video which shows it all?

Thanks in advance for your help, I really appreciate it.
Regards and cheers...

October 08, 2014, 02:57:53 AM
Reply #4

RoChess

  • ***
  • Information
  • Full Member
  • Posts: 61
Im sorry if I maybe sound a little stupid but how do I connect audio? In HomeGenie? Physical?

I run HomeGenie on a Windows 7 box, so HG can output sounds to my speakers via the Windows sound driver.

Do not have a Raspberry Pi myself, but I know they have HDMI output, which can carry sound. I expect if you hook up a TV to one and run that C# script (or use any of the other languages), that the synthesized voices will start to speak to you.

Trial and error will get you far as well, which has been my main experience.

October 10, 2014, 05:55:30 PM
Reply #5

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
Hello all,

Sorry for my late reply, I didnt have much time the last few days.
I've tried to get the "Hello World" speech synthesis to work, but no luck.
I did exactly what was is the post of MickEE..http://www.homegenie.it/forum/index.php?topic=372.msg2155#msg2155 but I only get errors.

Is there someone who's got it working and  can explain me how?

Im also trying to get the lights on at sunset, this looks really simple, but what variables are returned to trigger on, and how from earthtools, or wunderground.

I'm love this program, but I need a few examples how to handle things.

Kind regagds and cheers...

Thank you in advance



October 10, 2014, 07:23:22 PM
Reply #6

RoChess

  • ***
  • Information
  • Full Member
  • Posts: 61
Had a little time myself, and tried the same sample.

The 'notify' message works fine, but you are right the 'say' part for text-to-speech did not work for me either, whereas that Windows 7 box in question is fully configured to use the speech synthesizer.

Looks like a step is missing to make speech work in HomeGenie.

I did however not get any error messages, so not sure what you did wrong there. Did you use the 'compile' button before running the script?

October 10, 2014, 10:29:18 PM
Reply #7

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
Hello all / Dear Gene,
This is whats happening if I try the example....

Triggercode:
Program.Say("Hello, World!", "en-US");

Program code:
Program.Notify("Hello", "World");


Error
e
Line 10, Column 22 (Program Code):
    HomeGenie.Automation.Scripting.ScriptingInstance.EvaluateConditionBlock(): niet alle codepaden retourneren een waarde

What am I doing wrong, help is very appreciated..

Regards and cheers....

October 10, 2014, 11:35:28 PM
Reply #8

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
@RoChess

Win7 do not allow Services to use Audio (at least I couldn't find a way).
This will work on Win8 though.
To make it work on Win7, you gotta disable hg service and run it as a desktop app (by double-clicking the HomeGenie.exe file).

@DutchHans
please export and attach your program .hgx file, there must be an error somewhere.

g.

October 11, 2014, 03:40:44 AM
Reply #9

RoChess

  • ***
  • Information
  • Full Member
  • Posts: 61
To make it work on Win7, you gotta disable hg service and run it as a desktop app (by double-clicking the HomeGenie.exe file).


Figures, I have been running HG in console mode this entire time, except earlier today I had to close it for other reasons and reverted back to the service.

It was during that time I tested the voice stuff (Murphy's law), but switching HG back to console made the voice work.

Regarding your Win7/C# dilemma, there is the "interact with desktop" option for services that should allow for that. Enabling it however gives an error due to: http://technet.microsoft.com/en-us/library/cc756339(v=ws.10).aspx -- if memory serves me there is a way around that, so I will try to get more info for you on that.

October 11, 2014, 04:37:07 PM
Reply #10

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
Hello Gene,

First of all thank you for your quick response... really great!

I guess the attached file is what you mean...If not please let me know.
Hope you can figure it out...

Regards and cheers...

October 12, 2014, 09:17:10 PM
Reply #11

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
Hello Gene,

I did today a brand new installation.. uninstalled everything and deleted the leftovers manually.. then a clean installation.. then i ran the updates..I added only one module and tested the text to speech program.. but the result was the same.. an error and complete silence..
Just wanted you to know...

Maybe you've noticed that I am Dutch, if I can be helpful by translating things into Dutch, please let me know...

Regards and cheers...

October 12, 2014, 10:12:54 PM
Reply #12

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
in the trigger code there is wrong number of parameters used for Program.Notify, please referer to online documentation.


G.

October 13, 2014, 09:27:32 PM
Reply #13

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
Hello Gene,

It works!!
Thank you so much for your help.
Like I said before, if I can be of any help translating things into Dutch, please let me know.

Regards and cheers...