more G-Labs products

Author Topic: UPNP Device to trigger wizard scripts?  (Read 1186 times)

August 14, 2014, 12:28:12 PM
Read 1186 times

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Hello,

is there a way to make UPNP Devices to trigger wizard scripts?

Please see screenshot attached, the device is recognized by HG and I can control it via the widget and even sent a stream to it (to turn it on at certain times) by using the macro function and wizard scripts.

Is there a way in doing it the other way around, turning the UPNP Device on and playing a stream (via control at the device) is detected by HG and triggers a wizard script?

Many thanks for help

Regards

Jens

August 14, 2014, 01:47:44 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Event subscription is not implemented in the UPnP interface yet. So the only way to know the status of a property is to poll the UPnP device.
To find out all supported commands on an hg UPnP module see the source code:

https://github.com/genielabs/HomeGenie/blob/master/MIG/MIG/Interfaces/Protocols/UPnP.cs#L52

so, for example in a script you can do stuff like:

Code: [Select]
var mySmartTV = Modules.WithName("Smart TV");
mySmartTV.Command("AvMedia.SetVolume").Set("50");
var volume = mySmartTV.Command("AvMedia.GetVolume").Execute();

Cheers,
g.