VoxCommando

Help and Support (Using VoxCommando) => Kodi (XBMC) Frodo / Gotham / Isengard / Jarvis => Topic started by: lja on July 20, 2014, 05:02:21 PM

Title: XBMC, EventGhost and Lights
Post by: lja on July 20, 2014, 05:02:21 PM
Is it possible to have the lights turned off when the command "play" is given in Vox Commando?
Title: Re: XBMC, EventGhost and Lights
Post by: jitterjames on July 20, 2014, 06:06:01 PM
Yes.
Title: Re: XBMC, EventGhost and Lights
Post by: lja on July 20, 2014, 06:20:09 PM
Yes.

OK Thanks. I will do some more research and hopefully find a way.
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on July 20, 2014, 06:33:33 PM
This kind of thing is exactly what VC is designed for.

The issue is more to do with hardware. Obviously, some kind of automated lighting is needed, whether it's a Hue light or a Belkin Wemo, or Z-wave lights with a Vera controller, or X-10 lights, etc.

You mention Eventghost in your subject line, but it's not clear why. VoxCommando can communicate directly with a variety of home automation devices, so Eventghost *may* be necessary, or not.

The details of how such a VC command would be built will depend on specifics of your hardware, and the conditions under which you want this scenario (i.e., every time a "play movie" XBMC command is issued, or only in certain circumstances).
Title: Re: XBMC, EventGhost and Lights
Post by: lja on July 20, 2014, 10:21:03 PM
This kind of thing is exactly what VC is designed for.

The issue is more to do with hardware. Obviously, some kind of automated lighting is needed, whether it's a Hue light or a Belkin Wemo, or Z-wave lights with a Vera controller, or X-10 lights, etc.

You mention Eventghost in your subject line, but it's not clear why. VoxCommando can communicate directly with a variety of home automation devices, so Eventghost *may* be necessary, or not.

The details of how such a VC command would be built will depend on specifics of your hardware, and the conditions under which you want this scenario (i.e., every time a "play movie" XBMC command is issued, or only in certain circumstances).

Thanks @Nime5ter for taking the time to provide the info. I do not normally use XBMC but after purchasing Vox and reading on this forum I wanted to try some of the things I saw here. I am a long time user of MediaBrowser. However I have now set up XBMC as I wanted to try the voice controlled approach which is not yet available for MediaBrowser. Currently I have it mostly working on XBMC with my remote where play turns off the lights on start of movie, dims at pause, turns on lights on stop  of movie. This is using EventGhost. My lights are controlled by Smartlinc 2412n. I am therefore looking to voice control with Vox to perform the same process as the remote. I will continue the search.
Title: Re: XBMC, EventGhost and Lights
Post by: Kalle on July 21, 2014, 03:54:09 AM
Hi lja, please try the forum search with insteon and you will find all for what you looking for.
You can use the scrape action in VC to get access to the insteon API and you will find how the command looks like with examples here (thanks to nime5ter): http://www.leftovercode.info/smartlinc.html (http://www.leftovercode.info/smartlinc.html)
Title: Re: XBMC, EventGhost and Lights
Post by: jitterjames on July 21, 2014, 10:16:29 AM
If you are already using EventGhost anyway it might be easier to send a message to EventGhost.

If you could tell us more about what you already have set up (in some detail) it will be easier for us to help.
Title: Re: XBMC, EventGhost and Lights
Post by: lja on July 21, 2014, 01:39:49 PM
Hi lja, please try the forum search with insteon and you will find all for what you looking for.
You can use the scrape action in VC to get access to the insteon API and you will find how the command looks like with examples here (thanks to nime5ter): http://www.leftovercode.info/smartlinc.html (http://www.leftovercode.info/smartlinc.html)

Thanks Kalle. I have already and am still reading some of the insteon info on the forum. Tried scrape action: http://192.168.1.200/3?02621D1E3B0F11FF=I=3 However no luck. The relative info was changed to mine. Thanks for the link. Will review.
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on July 21, 2014, 01:57:26 PM
The url you post does not include a port number. Aussie mate mentions in a follow-up thread that he had to specify the port number for his Insteon hub, so you cold try that if you haven't yet.

See: http://voxcommando.com/forum/index.php?topic=1395.msg12148;topicseen#msg12148

See also: http://voxcommando.com/forum/index.php?topic=1423.0 (linked to from the Home Automation page of the wiki)
Title: Re: XBMC, EventGhost and Lights
Post by: lja on July 21, 2014, 08:10:54 PM
Thanks to
@nime5ter
@jitterjames
@kalle

With your help and lots of reading, it is almost where I want it. I now have the basic actions working. It seems my main problem was the port. After resetting the port it all started to work. Thanks for your help.
Title: Re: XBMC, EventGhost and Lights
Post by: lja on October 31, 2014, 11:28:19 PM
The attached turns off lights when the movie starts. I would like to be able to turn the lights on when the movie ends. Is there a way to do this? I have the info for the scrape action to turn the lights on. If so can you help?

XBMC:Gotham 13.2
Vox: 2.007

Thanks.

Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on November 01, 2014, 09:52:52 AM
Yes, you can use the event that is generated when XBMC stops playing a movie. (The same could be done for turning the light off, as an event is generated when a movie starts as well.)

e.g. when a movie stops playing in XBMC, it should be generating the event: XBMC.Player.OnStop.movie.

Then your command would just have whatever actions you want to happen when the movie stops, such as turning the lights on.

http://voxcommando.com/mediawiki/index.php?title=Events
http://voxcommando.com/mediawiki/index.php?title=Video_Tutorials
Title: Re: XBMC, EventGhost and Lights
Post by: lja on November 01, 2014, 04:01:52 PM
Thanks nime5ter. I had tried the XBMC.Player.OnStop.movie without luck, but after rereading the wiki you posted got it to work. Still playing with XBMC while waiting for a Mediabrowser plugin hopefully sometime in the not too distant future.
Title: Re: XBMC, EventGhost and Lights
Post by: lja on November 06, 2014, 03:43:31 PM
Thanks nime5ter. I had tried the XBMC.Player.OnStop.movie without luck, but after rereading the wiki you posted got it to work. Still playing with XBMC while waiting for a Mediabrowser plugin hopefully sometime in the not too distant future.

@nime5ter
No longer working.
I noticed that the group XBMC Notifications and Events has a command XBMC.Player.OnPlay.movie listed, is this the proper location for XBMC.Player.OnStop.movie?
Title: Re: XBMC, EventGhost and Lights
Post by: jitterjames on November 06, 2014, 03:48:10 PM
@nime5ter
No longer working.

This is a meaningless statement which will accomplish nothing.

I noticed that the group XBMC Notifications and Events has a command XBMC.Player.OnPlay.movie listed, is this the proper location for XBMC.Player.OnStop.movie?

What are you asking?  Are you asking which group to put your new command in?

Why don't you tell us what you have done, and try to explain what is actually happening.  Maybe post your xml or some screenshots or a log or something.
Title: Re: XBMC, EventGhost and Lights
Post by: lja on November 06, 2014, 04:19:07 PM
This is a meaningless statement which will accomplish nothing.

What are you asking?  Are you asking which group to put your new command in?

Why don't you tell us what you have done, and try to explain what is actually happening.  Maybe post your xml or some screenshots or a log or something.

Thanks for your response. The comment No longer working relates to previous comment that it was working and hence the reason for my question re location of new command. Yes I was asking which group.

I am trying to have the lights turn on at the end of the movie. Is the required log from Vox?

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--C:\Users\Louis\Desktop\VcGrp_XBMC Notifications and Events.xml-->
<VoiceCommands version="">
    <!--this is an exported VoxCommando group-->
    <commandGroup open="False" name="XBMC Notifications and Events" enabled="True" prefix="" priority="0" requiredProcess="" description="">
        <command id="414" name="connect on focus" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>XJson.Connect</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <event>focused.XBMC</event>
        </command>
        <command id="501" name="connect" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>XJson.Connect</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <if ifBlockDisabled="False" ifNot="False">
                <ifType>LastActionSuccess</ifType>
                <ifParams>&amp;&amp;</ifParams>
                <then>
                    <action>
                        <cmdType>TTS.Speak</cmdType>
                        <params>
                            <param>Connected</param>
                        </params>
                        <cmdRepeat>1</cmdRepeat>
                    </action>
                </then>
                <else>
                    <action>
                        <cmdType>TTS.Speak</cmdType>
                        <params>
                            <param>Unable to establish connection</param>
                        </params>
                        <cmdRepeat>1</cmdRepeat>
                    </action>
                </else>
            </if>
            <phrase>connect</phrase>
        </command>
        <command id="506" name="disconnect" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>XJson.Disconnect</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>disconnect</phrase>
        </command>
        <command id="488" name="XBMC.Player.OnPlay.movie" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>XJson.Raw</cmdType>
                <params>
                    <param>Player.GetItem</param>
                    <param>"playerid":1,  "properties": ["title","cast"]</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.RegEx</cmdType>
                <params>
                    <param>"name".*?"(.*)"</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.MatchConcat</cmdType>
                <params>
                    <param>, </param>
                    <param>3</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>XJson.ParseTokens</cmdType>
                <params>
                    <param>Now playing {item.title} starring {lastresult}</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>XJson.SoftMute</cmdType>
                <params>
                    <param>60</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.SpeakSync</cmdType>
                <params>
                    <param>{LastResult}</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>XJson.SoftUnMute</cmdType>
                <params />
                <cmdRepeat>1</cmdRepeat>
            </action>
            <event>XBMC.Player.OnPlay.movie</event>
        </command>
        <command id="515" name="XBMC.Player.OnStop.movie" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>XJson.Raw</cmdType>
                <params>
                    <param>Player.Stop</param>
                    <param>"playerid":1,  "properties": ["title","cast"]</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Scrape</cmdType>
                <params>
                    <param>http://192.168.1.300:25005/3?02621D1E3B0F11FF=I=3</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.RegEx</cmdType>
                <params>
                    <param>"name".*?"(.*)"</param>
                </params>
                <cmdRepeat>0</cmdRepeat>
            </action>
            <action>
                <cmdType>Results.MatchConcat</cmdType>
                <params>
                    <param>, </param>
                    <param>3</param>
                </params>
                <cmdRepeat>0</cmdRepeat>
            </action>
            <action>
                <cmdType>XJson.ParseTokens</cmdType>
                <params>
                    <param>Now playing {item.title} starring {lastresult}</param>
                </params>
                <cmdRepeat>0</cmdRepeat>
            </action>
            <action>
                <cmdType>XJson.SoftMute</cmdType>
                <params>
                    <param>60</param>
                </params>
                <cmdRepeat>0</cmdRepeat>
            </action>
            <action>
                <cmdType>TTS.SpeakSync</cmdType>
                <params>
                    <param>{LastResult}</param>
                </params>
                <cmdRepeat>0</cmdRepeat>
            </action>
            <action>
                <cmdType>XJson.SoftUnMute</cmdType>
                <params />
                <cmdRepeat>0</cmdRepeat>
            </action>
            <event>XBMC.Player.OnStop.movie</event>
        </command>
        <command id="463" name="XBMC.Player.OnSpeedChanged" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="this action is disabled by default!">
            <action>
                <cmdType>TTS.Speak</cmdType>
                <params>
                    <param>speed changed to {1}</param>
                </params>
                <cmdRepeat>0</cmdRepeat>
            </action>
            <event>XBMC.Player.OnSpeedChanged</event>
        </command>
    </commandGroup>
</VoiceCommands>
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on November 06, 2014, 04:31:25 PM
No, that's not a log. It looks like you simply exported the command group XBMC Notifications and Events.

[Edit: sorry, I misunderstood your question about the log; yes, James meant the VC log.]

Can you please post the xml of the command that you tried to make for turning on the lights when a movie ends?

[Edit: sorry, now I see it in this command group -- just the one command would have been fine.]

Also, can you please enable logging in VoxCommando, then try using the command that you made (i.e. give the command to start a movie in XBMC, watch it for a few seconds, then stop the movie). Then go find the log file in your VC directory, and attach that to your next post.

When James says that "no longer working" is not helpful, he means that we need information about your setup in order to diagnose what "not working" means. Not working could mean a lot of different things -- is the movie not stopping, is the light not turning on, is the event not being generated ...

This point about the pointlessness of "not working" is explained in "When you ask" and "Specific tips" of the Getting Support wiki page: http://voxcommando.com/mediawiki/index.php?title=Getting_support

The same page also explains what a log is (http://voxcommando.com/mediawiki/index.php?title=Log), and how to post the XML for a specific command on the forum (which is a lot faster an more useful than a screenshot of your command -- look at my forum signature, where there is also a link) -- as well as the general importance of doing these steps when you're having problems with a command.

Please read over that Getting Support wiki page, and also try to do as described above. Thanks.


Title: Re: XBMC, EventGhost and Lights
Post by: jitterjames on November 06, 2014, 04:34:23 PM
My point is that we don't know WHAT "is not working".  That is why we specifically tell you in the "getting help" section of the wiki to not say that:

http://voxcommando.com/mediawiki/index.php?title=Getting_support#Other_Specific_Tips

We don't know what is happening on your computer, so you have to tell us.  One way to help us to know what is happening is to explain the sequence of events.  What you do, and what VC does including what appears in the history window.  In this case we need to know, is the event is being fired at all, and if so, is the command associated with the event being executed, and if so, is the scrape action being executed.  Are there any errors shown etc.

Yes a VC log can sometimes be helpful: http://voxcommando.com/mediawiki/index.php?title=Log

It doesn't really matter what group you put your command into as long as the group is not disabled.

Your command should probably work except that you have an extra action in there that I do not understand.  Why are you calling player.Stop?  The player has already stopped, which is why the event was fired.  Even if you are going to call Player.Stop, why are you also passing the params: "playerid":1,  "properties": ["title","cast"]
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on November 06, 2014, 05:16:30 PM
In theory, the command to turn lights back on at the end of a movie needs just one action.

In the following example, I've added a completely gratuitous TTS message that you can delete.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.8-->
<command id="515" name="XBMC post movie lights back on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://192.168.1.300:25005/3?02621D1E3B0F11FF=I=3</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>Thanks for watching. Hope you enjoyed the show.|Is it just me, or do we need some light in here?</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>XBMC.Player.OnStop.movie</event>
</command>

As James says, the command can go in any command group (an XBMC-related group makes the most sense), but should not go in a group that is usually kept disabled.
Title: Re: XBMC, EventGhost and Lights
Post by: lja on November 07, 2014, 11:25:42 AM
@nime5ster

Thanks. Will try.
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on November 07, 2014, 11:48:55 AM
If the command that I posted is not successfully turning on your lights when a movie stops playing in XBMC, the next steps are:

1. Enable logging in VC if it's not enabled, go through the movie playing scenario as you would in practice, then attach the log to your next post.
2. Provide us with more information about your system and what you are doing; for example --

 a) Is XBMC running on the same computer as VC?
 b) What version of XBMC are you running?
Title: Re: XBMC, EventGhost and Lights
Post by: lja on November 09, 2014, 11:51:10 PM
@nime5ter

Thanks. The lights are turning on. Really appreciate your help.
Title: Re: XBMC, EventGhost and Lights
Post by: jitterjames on November 10, 2014, 09:41:50 AM
It is a shame we never found out what was going wrong.
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on November 10, 2014, 10:40:19 AM
I guess we'll never know ...  :biglaugh

I'll take the opportunity to remind folks that when you edit commands and create new commmands, you should save the command tree and exit the tree editor so that VoxCommando can rebuild edited command groups. Saving the tree is not enough.

Until that is done, your new commands "won't work". Sure, you can test them with "save and execute", but don't expect saying the voice command or an event to trigger them.

Title: Re: XBMC, EventGhost and Lights
Post by: lja on November 10, 2014, 11:59:35 AM
Ok. I was still trying to discover why my first command worked turning on the lights and then did not work. The working command was on my test computer (lights turning on) and was then transferred to my HTPC (lights not turning on). I changed the code to that which I posted and again that did not turn the lights on. After that I requested your help. On seeing and testing @nime5ter's post, I realized that it was similar to the one I first tried. That prompted me to recheck my original command which no longer turned the lights on (still on my HTPC). On comparing nime5ster's with my original, I noticed an error in the url with scrape. This might have resulted when I transferred the command from my test computer to my HTPC. Making the url adjustment in my original command resulted in the lights turning on also. Thanks for your help and please accept my apology for taking up your time with this issue.
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on November 10, 2014, 01:16:40 PM
Thanks for the update, lja.

We like to know how problems end up being resolved because if other users are having similar issues it gives them ideas about what to check in their own commands.
Title: Re: XBMC, EventGhost and Lights
Post by: lja on March 18, 2015, 12:41:57 AM
Looking for some help please:

VC:2.142
Kodi: Helix rc1
Kodi on same computer as Vox

Situation: Upgraded Kodi

Goal: To turn lights off at end of movie
Results with present setup: Lights are turned on at end of intro not at end of movie

Present
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<command id="515" name="KODI post movie lights back on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://192.168.1.100:25005/3?02621D1E3B0F11FF=I=3</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>Thanks for watching. This has been a Galaxy Home Cinema Presentation. Hope you enjoyed the show.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>KODI.Player.OnStop.movie</event>
</command>


Also tried this:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<commandGroup open="False" name="KODI movie time " enabled="False" prefix="" priority="0" requiredProcess="" description="">
  <command id="1196" name="Set movie now playing variable" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>movieNowPlaying</param>
        <param>true</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>KODI.Player.OnPlay.movie</event>
  </command>
  <command id="1197" name="End of movie, turn lights back up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{var.movieNowPlaying}&amp;&amp;true</ifParams>
      <then>
        <action>
          <cmdType>Scrape</cmdType>
          <params>
            <param>http://192.168.1.100:25005/3?02621D1E3B0F11FF=I=3</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>I hope you enjoyed the show.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>movieNowPlaying</param>
            <param>false</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <event>KODI.Player.OnStop.movie</event>
  </command>
</commandGroup>

Thanks for any help
Title: Re: XBMC, EventGhost and Lights
Post by: jitterjames on March 18, 2015, 10:23:42 AM
Kodi's event system is not very sophisticated.  It generates movie stop events any time any kind of video stops playing.  However we do have access to the ID of the movie that has stopped.  In the case of outros and youtube videos etc. which are not part of your movie library the ID will appear as No ID so we can use this to tell whether it is really a movie that has stopped playing.

So if the payload {1} for this event is equal to NoID then we don't do anything, otherwise we turn the lights on.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<command id="515" name="KODI post movie lights back on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;no ID</ifParams>
    <then />
    <else>
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>http://192.168.1.100:25005/3?02621D1E3B0F11FF=I=3</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Thanks for watching. This has been a Galaxy Home Cinema Presentation. Hope you enjoyed the show.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>KODI.Player.OnStop.movie</event>
</command>

This should work any time you stop playing a movie and it won't matter if you are using cinema experience or just playing the movie normally.

There are at least 3 other possible methods you could use to solve this problem depending on your needs, but this is the simplest to implement.
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on March 18, 2015, 10:51:04 AM
@lja - As a side note, this may not matter if you don't ordinarily use a voice command to start watching your movies; however, if you'd like for that voice command to work correctly, you can fix the command pretty easily.

Based on the log you posted, somehow the correct action was edited in your Show Movie command, changing the proper syntax for payload {1} to just 1.

This means KODI will always play the movie with ID 1 in your library after the intro. For it to play the movie you've asked for, the command needs to use payload {1}.

It seems that currently your Show Movie command has a line:

XJson.Raw --> Addons.ExecuteAddon "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=1" ]

That should be:

XJson.Raw --> Addons.ExecuteAddon "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid={1}" ]
Title: Re: XBMC, EventGhost and Lights
Post by: lja on March 18, 2015, 03:20:42 PM
@jitterjames

Thanks for the explanation and example. Will try it.
Title: Re: XBMC, EventGhost and Lights
Post by: lja on March 18, 2015, 03:25:26 PM
@lja - As a side note, this may not matter if you don't ordinarily use a voice command to start watching your movies; however, if you'd like for that voice command to work correctly, you can fix the command pretty easily.

Based on the log you posted, somehow the correct action was edited in your Show Movie command, changing the proper syntax for payload {1} to just 1.

This means KODI will always play the movie with ID 1 in your library after the intro. For it to play the movie you've asked for, the command needs to use payload {1}.

It seems that currently your Show Movie command has a line:

XJson.Raw --> Addons.ExecuteAddon "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=1" ]

That should be:

XJson.Raw --> Addons.ExecuteAddon "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid={1}" ]

@ nime5ter Thanks. On checking the history shows:XJson.Raw --> Addons.ExecuteAddon "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid=1" ]

However the command shows it correctly:XJson.Raw --> Addons.ExecuteAddon "wait": false, "addonid": "script.cinema.experience", "params": [ "movieid={1}" ]
Title: Re: XBMC, EventGhost and Lights
Post by: nime5ter on March 18, 2015, 03:32:21 PM
Ha. Yes, my mistake. It just so happens that your movie "2 Guns" has the ID value of 1.
Title: Re: XBMC, EventGhost and Lights
Post by: jitterjames on March 18, 2015, 03:33:44 PM
another option is to use the CinemaExerience home automation script.

1) Replace the "home_automation.py" file which is found in:
Code: [Select]
%appdata%\Kodi\userdata\addon_data\script.cinema.experience\ha_scripts with the attached "home_automation.py" file.

2) Enable the homeautomation in the CE plugin settings and enable any triggers you want.

You should see events in VoxCommando now, but only when using Cinema Experience, not when playing movies normally in Kodi.

Or if you already have a customized home_automation.py file you can edit it to add the extra line of code to send the event using UDP.  Just be careful not to mess up the indentation and that means watch out for tabs / spaces.

Code: [Select]
        if trigger in triggers:
            utils.broadcastUDP( "VC.TriggerEvent&&Kodi.CinEx.%s" %trigger, 33000,'255.255.255.255' )
            utils.log( " - [ home_automation.py ] - Trigger %s" % trigger, xbmc.LOGNOTICE )
Title: Re: XBMC, EventGhost and Lights
Post by: lja on March 19, 2015, 12:41:38 PM
@jitterjames

"another option is to use the CinemaExerience home automation script."

Thanks. I will try the replacement approach. But before doing so, is any adjustment necessary in your attached file?
Will the Kodi.Player.OnStop.movie be still needed in the LCB?
Title: Re: XBMC, EventGhost and Lights
Post by: jitterjames on March 19, 2015, 12:57:24 PM
I suggest you try the simple approach first.

as shown here: http://voxcommando.com/forum/index.php?topic=1674.msg17967#msg17967

You only need to replace your command with the one that I provided.  What could be easier?