We have moved at community.getvera.com

Author Topic: Dynamic TTS based on device that triggered scene  (Read 897 times)

Offline mrv777

  • Full Member
  • ***
  • Posts: 158
  • Karma: +1/-4
Dynamic TTS based on device that triggered scene
« on: February 17, 2015, 04:21:59 pm »
Hello,

I was hoping someone would be kind enough to help me with this.  Currently I have this code for when a door sensor is triggered:
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say",
                 {Text="Door opened", Language="en", Volume=40},
                 13)

I would like the code to make the sonos say which door was opened.  I know how to do this with a separate scene for each sensor, but I was hoping I could make this one scene dynamic.  Is there a way to add to this code the name of the door sensor that triggered the scene for the sonos to say it?

Thanks in advance

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Dynamic TTS based on device that triggered scene
« Reply #1 on: February 17, 2015, 06:39:08 pm »
There isn't any way for Lua in a scene's Luup tab to determine where the trigger came from.

In UI5, you can add Lua to each trigger using the Luup Event tab. This allows you to set a global variable that can be used in the main scene Lua to tell which trigger fired.

This is not currently possible in UI7 but may be reinstated in a future release.

Offline mrv777

  • Full Member
  • ***
  • Posts: 158
  • Karma: +1/-4
Re: Dynamic TTS based on device that triggered scene
« Reply #2 on: February 17, 2015, 07:54:18 pm »
Rex,

Thanks for letting me know and the help.  I'll just make a separate scene for each door for now.

Thanks!