This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Official SDK2

[APP] Kodi [2.2.0]

1171820222326

Comments

  • EvertorN said:
    @Reemster @B3rt
    Do you guys use a 3rd party addon to watch movies (e.g. exodus) or are those movies from your own library? 'Stop' works perfectly fine for me. I haven't tried 'Movie stop' in a while, so I'd have to check that.
    I only use the app exodus.
  • @B3rt Stop should work fine for you. @Reemster, not sure how Exodus responds to the events like stop and movie stop, I'll have to check this.. This might be a limitation of Exodus because the Kodiapp can't pick up 'stop' if Exodus does not send Kodi the appropriate command.
  • EvertorN said:
    @B3rt Stop should work fine for you. @Reemster, not sure how Exodus responds to the events like stop and movie stop, I'll have to check this.. This might be a limitation of Exodus because the Kodiapp can't pick up 'stop' if Exodus does not send Kodi the appropriate command.
    should.... but it does not, nothing happens.
    Play, pause, resume work fine but when stop is pressed nothing happens.
  • B3rt said:
    EvertorN said:
    @B3rt Stop should work fine for you. @Reemster, not sure how Exodus responds to the events like stop and movie stop, I'll have to check this.. This might be a limitation of Exodus because the Kodiapp can't pick up 'stop' if Exodus does not send Kodi the appropriate command.
    should.... but it does not, nothing happens.
    Play, pause, resume work fine but when stop is pressed nothing happens.
    Few things to check: 
    - Are you sure you have configured your flow correctly?
    - Can you send me your log details when you press stop (Apps > Kodi)?
    - Are you using the trigger card 'Kodi has been stopped / Kodi is gestopt'? 

    When I check my log, I can see something like this when I press stop:
    2017-01-30T11:01:03.748Z"onKodiStop"
    2017-01-30T11:01:03.751Z"Triggering flow " "kodi_stop"
  • EvertorN said:
    B3rt said:
    EvertorN said:
    @B3rt Stop should work fine for you. @Reemster, not sure how Exodus responds to the events like stop and movie stop, I'll have to check this.. This might be a limitation of Exodus because the Kodiapp can't pick up 'stop' if Exodus does not send Kodi the appropriate command.
    should.... but it does not, nothing happens.
    Play, pause, resume work fine but when stop is pressed nothing happens.
    Few things to check: 
    - Are you sure you have configured your flow correctly?
    - Can you send me your log details when you press stop (Apps > Kodi)?
    - Are you using the trigger card 'Kodi has been stopped / Kodi is gestopt'? 

    When I check my log, I can see something like this when I press stop:
    2017-01-30T11:01:03.748Z"onKodiStop"
    2017-01-30T11:01:03.751Z"Triggering flow " "kodi_stop"
    there is no log of a stop event...

    only play, resume, pause etc:
    [code]
    2017-02-02T00:17:07.397Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.397Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:07.398Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.398Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:07.400Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.400Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:07.401Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.401Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:07.402Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.403Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:33.264Z"onKodiPlay()"
    2017-02-02T00:17:33.264Z"Triggering flow kodi_playing_something"
    2017-02-02T00:17:33.278Z"Triggering flow kodi_resume"
    2017-02-02T00:17:33.288Z"onKodiPlay()"
    [/code]

    I made a versy simple test flow, on start, pause, resume and stop homey should say a numer 1,2,3 or 4
    When stop is pressed it should say '4'...

    All commands work exept stop, here nothing happens, no speach and no log entry.

    I tried to delete the flow, create an other one etc, on all commands it works exept on stop.


  • B3rt said:
    EvertorN said:
    B3rt said:
    EvertorN said:
    @B3rt Stop should work fine for you. @Reemster, not sure how Exodus responds to the events like stop and movie stop, I'll have to check this.. This might be a limitation of Exodus because the Kodiapp can't pick up 'stop' if Exodus does not send Kodi the appropriate command.
    should.... but it does not, nothing happens.
    Play, pause, resume work fine but when stop is pressed nothing happens.
    Few things to check: 
    - Are you sure you have configured your flow correctly?
    - Can you send me your log details when you press stop (Apps > Kodi)?
    - Are you using the trigger card 'Kodi has been stopped / Kodi is gestopt'? 

    When I check my log, I can see something like this when I press stop:
    2017-01-30T11:01:03.748Z"onKodiStop"
    2017-01-30T11:01:03.751Z"Triggering flow " "kodi_stop"
    there is no log of a stop event...

    only play, resume, pause etc:
    [code]
    2017-02-02T00:17:07.397Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.397Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:07.398Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.398Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:07.400Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.400Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:07.401Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.401Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:07.402Z"onKodiGenericEvent() " "kodi_pause"
    2017-02-02T00:17:07.403Z"Triggering flow " "kodi_pause"
    2017-02-02T00:17:33.264Z"onKodiPlay()"
    2017-02-02T00:17:33.264Z"Triggering flow kodi_playing_something"
    2017-02-02T00:17:33.278Z"Triggering flow kodi_resume"
    2017-02-02T00:17:33.288Z"onKodiPlay()"
    [/code]

    I made a versy simple test flow, on start, pause, resume and stop homey should say a numer 1,2,3 or 4
    When stop is pressed it should say '4'...

    All commands work exept stop, here nothing happens, no speach and no log entry.

    I tried to delete the flow, create an other one etc, on all commands it works exept on stop.


    Like I said, you have to use the trigger card 'Kodi has been stopped / Kodi is gestopt' for a normal stop event (you press the square stop button on your remote). The trigger card in your example will only fire when the movie has stopped (including credits, so the actual file has reached the end) NOT when you press stop during a movie..
  • wingiewingie Member
    edited February 2017
    @EvertorN
    just logged in my homey to perform an update (1.1.4) and say that your app was updated to 1.7.0 but it had a red cross next to it. So i looked at that error message and captured it for you. (this is/was on 1.1.2 firmware, i'm gonna upgrade in a couple of seconds.)

    It's a great app but missing one option (request) for me and thats set a delay before it's gonna search for a movie. My intel nuc needs some time to boot from PXE and the kodi app already want's to perform the search action after "welke film wil je kijken" and gives a error " kan het apparaat niet vinden". I don't know if it's possible to build this in the flow cards (because when mediaserver is already running it shouldn't wait for x seconds) 
  • wingie said:
    @EvertorN
    just logged in my homey to perform an update (1.1.4) and say that your app was updated to 1.7.0 but it had a red cross next to it. So i looked at that error message and captured it for you. (this is/was on 1.1.2 firmware, i'm gonna upgrade in a couple of seconds.)

    It's a great app but missing one option (request) for me and thats set a delay before it's gonna search for a movie. My intel nuc needs some time to boot from PXE and the kodi app already want's to perform the search action after "welke film wil je kijken" and gives a error " kan het apparaat niet vinden". I don't know if it's possible to build this in the flow cards (because when mediaserver is already running it shouldn't wait for x seconds) 
    Thanks for the heads up. I was already aware of this and already fixed this. v1.7.1 is awaiting approval :).

    As for your delay, I need to know a bit more about your setup. How are you waking your device? 

    I think you'd be able to handle this in flows. v1.7.0 contains a new trigger card 'when homey connects to Kodi'. This is an event that indicates the Kodi app is ready to take commands. So what you could do is:
    - Configure a flow that triggers on 'When homey connects to Kodi', then set a variable 'Kodi is ready'
    - Use that variable to introduce a delay in your commands

    I'm not a 100% sure if this will work. If not, give me some more information of your setup and we'll find a way to make it work :)
  • EvertorN said:
    wingie said:
    @EvertorN
    just logged in my homey to perform an update (1.1.4) and say that your app was updated to 1.7.0 but it had a red cross next to it. So i looked at that error message and captured it for you. (this is/was on 1.1.2 firmware, i'm gonna upgrade in a couple of seconds.)

    It's a great app but missing one option (request) for me and thats set a delay before it's gonna search for a movie. My intel nuc needs some time to boot from PXE and the kodi app already want's to perform the search action after "welke film wil je kijken" and gives a error " kan het apparaat niet vinden". I don't know if it's possible to build this in the flow cards (because when mediaserver is already running it shouldn't wait for x seconds) 
    Thanks for the heads up. I was already aware of this and already fixed this. v1.7.1 is awaiting approval :).

    As for your delay, I need to know a bit more about your setup. How are you waking your device? 

    I think you'd be able to handle this in flows. v1.7.0 contains a new trigger card 'when homey connects to Kodi'. This is an event that indicates the Kodi app is ready to take commands. So what you could do is:
    - Configure a flow that triggers on 'When homey connects to Kodi', then set a variable 'Kodi is ready'
    - Use that variable to introduce a delay in your commands

    I'm not a 100% sure if this will work. If not, give me some more information of your setup and we'll find a way to make it work :)
    The best solution i think to solve the connection problem is to do it in reverse, so do not pull but push the kodi info.

    You first have to create a little python kodi addon to install on kodi which pushes info to homey.
    The if you do something on kodi, for example press play, kodi gives then a api call to homey to trigger a flow of your app, homey does the rest.

    This way micasaverde (vera) worked, it was a simple small addon install in kodi where you had to set the IP of your vera unit (in this case homey) and some setting where you could  set what to trigger, for example only trigger on movies or playing music, trigger only if it is night etc(this kind of settings, but this can also be done in homey app)..

    Using kodi to trigger a flow you loose the whole (re)connection and polling problem.
    The flow card system stay as it is, the only change would be the way homey gets its info from kodi.

    Hope this info helps and is usable!
  • B3rt said:
    EvertorN said:
    wingie said:
    @EvertorN
    just logged in my homey to perform an update (1.1.4) and say that your app was updated to 1.7.0 but it had a red cross next to it. So i looked at that error message and captured it for you. (this is/was on 1.1.2 firmware, i'm gonna upgrade in a couple of seconds.)

    It's a great app but missing one option (request) for me and thats set a delay before it's gonna search for a movie. My intel nuc needs some time to boot from PXE and the kodi app already want's to perform the search action after "welke film wil je kijken" and gives a error " kan het apparaat niet vinden". I don't know if it's possible to build this in the flow cards (because when mediaserver is already running it shouldn't wait for x seconds) 
    Thanks for the heads up. I was already aware of this and already fixed this. v1.7.1 is awaiting approval :).

    As for your delay, I need to know a bit more about your setup. How are you waking your device? 

    I think you'd be able to handle this in flows. v1.7.0 contains a new trigger card 'when homey connects to Kodi'. This is an event that indicates the Kodi app is ready to take commands. So what you could do is:
    - Configure a flow that triggers on 'When homey connects to Kodi', then set a variable 'Kodi is ready'
    - Use that variable to introduce a delay in your commands

    I'm not a 100% sure if this will work. If not, give me some more information of your setup and we'll find a way to make it work :)
    The best solution i think to solve the connection problem is to do it in reverse, so do not pull but push the kodi info.

    You first have to create a little python kodi addon to install on kodi which pushes info to homey.
    The if you do something on kodi, for example press play, kodi gives then a api call to homey to trigger a flow of your app, homey does the rest.

    This way micasaverde (vera) worked, it was a simple small addon install in kodi where you had to set the IP of your vera unit (in this case homey) and some setting where you could  set what to trigger, for example only trigger on movies or playing music, trigger only if it is night etc(this kind of settings, but this can also be done in homey app)..

    Using kodi to trigger a flow you loose the whole (re)connection and polling problem.
    The flow card system stay as it is, the only change would be the way homey gets its info from kodi.

    Hope this info helps and is usable!
    Hi @EvertorN

    I think this is a great idea from @B3rt, is this possible?
  • it should be possible, this is how an other controller already works.

    Only problem here will be creating the kodi addon and that you have to install somthing on kodi aswell.
    How this kodi addon exactly works i don't know but maybe someone could use (take a look) at how they did it and change the api call to you controller.

    I have the addon here which vera uses on kodi if someone want to try it..
  • Hi @EvertorN

    With the latest update 1.7.0 i have a problem, when homey connect to kodi or shutdown and homey says something, it says 14-15 times again again and again, can you look into this? And can you make a trigger when kodi ends.

    Thanks and Cheers
  • olive said:
    Hi @EvertorN

    With the latest update 1.7.0 i have a problem, when homey connect to kodi or shutdown and homey says something, it says 14-15 times again again and again, can you look into this? And can you make a trigger when kodi ends.

    Thanks and Cheers
    i confirm this, all commands in the 'then' statement are performed muti times
  • I have still problems with that the app lost connection with my kodi. But the app don't show any logentries that the connection was broken, or something. Only the old entries when it worked. Turning OFF / ON the app, let the app working again.
  • B3rt said:
    olive said:
    Hi @EvertorN

    With the latest update 1.7.0 i have a problem, when homey connect to kodi or shutdown and homey says something, it says 14-15 times again again and again, can you look into this? And can you make a trigger when kodi ends.

    Thanks and Cheers
    i confirm this, all commands in the 'then' statement are performed muti times
    Same here.
    Got a flow that makes Homey say 'Enjoy the movie' when it starts, and it's always said twice now :tongue:
  • Alrighty guys, seems like something is wrong with 1.7. Hopefully I have some time tonight to have a look at it.

    For now, I think the easiest resolution would be to remove your device and re-add it. Or open up the edit device screen and press ok (without making changes) to edit your device.

    @olive Thanks for the donation, will definitely use it to buy me a beer :)
  • Guys, I can't reproduce the problem with the flows triggering multiple times. Every flow gets executed once over here. Could some of you do a clean install of the Kodi app and provide me with steps to reproduce this problem?

    @Reemster Could you provide me with the log details just before it stops working?
  • olive said:
    B3rt said:
    EvertorN said:
    wingie said:
    @EvertorN
    just logged in my homey to perform an update (1.1.4) and say that your app was updated to 1.7.0 but it had a red cross next to it. So i looked at that error message and captured it for you. (this is/was on 1.1.2 firmware, i'm gonna upgrade in a couple of seconds.)

    It's a great app but missing one option (request) for me and thats set a delay before it's gonna search for a movie. My intel nuc needs some time to boot from PXE and the kodi app already want's to perform the search action after "welke film wil je kijken" and gives a error " kan het apparaat niet vinden". I don't know if it's possible to build this in the flow cards (because when mediaserver is already running it shouldn't wait for x seconds) 
    Thanks for the heads up. I was already aware of this and already fixed this. v1.7.1 is awaiting approval :).

    As for your delay, I need to know a bit more about your setup. How are you waking your device? 

    I think you'd be able to handle this in flows. v1.7.0 contains a new trigger card 'when homey connects to Kodi'. This is an event that indicates the Kodi app is ready to take commands. So what you could do is:
    - Configure a flow that triggers on 'When homey connects to Kodi', then set a variable 'Kodi is ready'
    - Use that variable to introduce a delay in your commands

    I'm not a 100% sure if this will work. If not, give me some more information of your setup and we'll find a way to make it work :)
    The best solution i think to solve the connection problem is to do it in reverse, so do not pull but push the kodi info.

    You first have to create a little python kodi addon to install on kodi which pushes info to homey.
    The if you do something on kodi, for example press play, kodi gives then a api call to homey to trigger a flow of your app, homey does the rest.

    This way micasaverde (vera) worked, it was a simple small addon install in kodi where you had to set the IP of your vera unit (in this case homey) and some setting where you could  set what to trigger, for example only trigger on movies or playing music, trigger only if it is night etc(this kind of settings, but this can also be done in homey app)..

    Using kodi to trigger a flow you loose the whole (re)connection and polling problem.
    The flow card system stay as it is, the only change would be the way homey gets its info from kodi.

    Hope this info helps and is usable!
    Hi @EvertorN

    I think this is a great idea from @B3rt, is this possible?
    Thanks for the suggestion guys. I initially wanted to do it this way, but choose not to do this for multiple reasons:
    - This would not fix the connection problem, but only reverse it. Homey can reboot / lose connection too and this would mean I have to poll for the Homey connection rather than the Kodi connection. Same problem, just reversed. The whole connection setup is sort of a chicken-egg problem, so polling is required. FYI, events like 'pause', 'stop' etc are already pushed from Kodi to Homey using TCP notifications.

    - I would still have to write a fairly big Homey app to deal with flow actions (e.g. 'Play this movie'). This would cause the app to be split into two parts in two programming language, thus hard to maintain.

    - It would mean the end users have to install two things and configure them twice: A Kodi addon and a Homey app. Some (non techy) end users are already struggling with the current setup, so this doesn't seem like a good idea to me..


  • maybe it is possible to make a second app..

    Just a simple kodi trigger app for play, pause etc to turn on other flows etc which is pushed from kodi.

    I believe that the most used functions are only play, pause etc just to turn of light when you watch a movie.

    The extra functions such as which movie title etc doesn't matter (in my case), i manage and see my movie collection in kodi, couchpotato, sickbeard etc, not in Homey. I don't see the extra value to need to know which movie is playing in Homey.
    If i want to watch a movie, homey only should respond to tune on/of the correct lighting etc. I does not have to manage kodi by starting, stopping a movie etc. Voice control does not work that good, when i have to use a remote there are better solutions like a logitech harmony to control it.
    I even prefer controlling stuff by button instead of voice.....

    Offtopic:
    The whole media idea of homey is not neccesarry is my opiniun, homey is a home/light controller not a mediaplayer, other devices do this much much better, these devices are desgined to do this.
    It is nice that homey respond on these devices but it should not take it over or try to replace it.


  • Don't forget that what does not seems useful to you could be very useful to others....
  • Aaron said:
    Don't forget that what does not seems useful to you could be very useful to others....
    i know, it is just my personal opinion, an other thing is with apps, how more complicated you make it how much easier and quicklier it will break..

    I am actually truly interested what people do with the info that Homey knows the title of the movie it is playing....
    I cannot image what to do with this kind of information with Homey what Kodi not allready does...
  • @B3rt ;
    The whole point of this app is to support a wide variety of functionality in order to respond to everyone's needs.

    For example, I personally use voice a lot. I have linked my Google Pixel's voice assistant to Homey and it works like a charm. Things like:
    'Play the latest episode of Shameless'
    'Play movie whatever'
    'Turn off the subtitles'
    'Pause'
    'Resume'

    As for the second app. I won't be building this. This would require 2 new apps (a new homey app and a new Kodi addon) and there won't be any benefit. Like I said, you'd still be facing the polling issue from Kodi to Homey when Homey reboots. I'd rather spend my time on extending and stabilising this app.
  • EvertorN said:
    @B3rt ;
    The whole point of this app is to support a wide variety of functionality in order to respond to everyone's needs.

    For example, I personally use voice a lot. I have linked my Google Pixel's voice assistant to Homey and it works like a charm. Things like:
    'Play the latest episode of Shameless'
    'Play movie whatever'
    'Turn off the subtitles'
    'Pause'
    'Resume'

    As for the second app. I won't be building this. This would require 2 new apps (a new homey app and a new Kodi addon) and there won't be any benefit. Like I said, you'd still be facing the polling issue from Kodi to Homey when Homey reboots. I'd rather spend my time on extending and stabilising this app.
    that is not a problem, i allready have the push from kodi running on my homey, it was just a sugestion.
  • B3rt said:
    EvertorN said:
    @B3rt ;
    The whole point of this app is to support a wide variety of functionality in order to respond to everyone's needs.

    For example, I personally use voice a lot. I have linked my Google Pixel's voice assistant to Homey and it works like a charm. Things like:
    'Play the latest episode of Shameless'
    'Play movie whatever'
    'Turn off the subtitles'
    'Pause'
    'Resume'

    As for the second app. I won't be building this. This would require 2 new apps (a new homey app and a new Kodi addon) and there won't be any benefit. Like I said, you'd still be facing the polling issue from Kodi to Homey when Homey reboots. I'd rather spend my time on extending and stabilising this app.
    that is not a problem, i allready have the push from kodi running on my homey, it was just a sugestion.
    That's alright. Have you uploaded the code to github? Keen to have a look at it.
  • no, because i did not use any code in homey for this.

    I just added some http get flows and let my synology nas cal them if kodi player changed state.
    I was allready monitoring kodi on my NAS using bash scripts and saving some info in a database (all on my NAS), i expanded the script, when a player state occurs (play, pause, resume and stop) it does a http call to Homey and so trigger a flow 'on play' do this on stop do that etc etc.
  • EvertorNEvertorN Member
    edited February 2017
    B3rt said:
    no, because i did not use any code in homey for this.

    I just added some http get flows and let my synology nas cal them if kodi player changed state.
    I was allready monitoring kodi on my NAS using bash scripts and saving some info in a database (all on my NAS), i expanded the script, when a player state occurs (play, pause, resume and stop) it does a http call to Homey and so trigger a flow 'on play' do this on stop do that etc etc.
    Makes sense.. The reason this works well for you is because you use this for 1 way communication. You use the HTTP protocol, so whenever something happens on Kodi it will:
    - Setup a HTTP connection to Homey
    - Trigger the flow

    My app uses the TCP protocol to establish a persistent connection that allows for two-way communication (e.g. kodi>homey on 'pause' and homey>kodi on 'start movie'). So whenever one of the devices reboots, the connection is lost and needs to be re-established by polling. This is done by the Homey app and as of 1.7, I have had no problems of connection loss.

    Again, the reason your solution works well is because you set up a connection at the time of the event (HTTP call). This allows one-way communication only and is therefore not a wanted solution for this app since the Kodi app for Homey requires two-way communication.

    Hope this clears things up for you.

    Also, if everyone has connection problems on 1.7 (or higher) please let me know so we can figure out what's wrong.

  • yep, just one way, no connection problems and works like a charm..
    Only looking for someone who could create a kodi addon to do the http call to homey.

    Is does not have to do more when i want to contol the lighting if i start a movie, within the flows i can do the filtering if or when i want to swicth on or off lights when i want to watch a movie.

    Currently my NAS does this, it filters if it is a movie, musi or a tv show i am wathing.
    It only triggers when i watching a movie, so not when playing music or watching a TV show.
  • edited February 2017
    B3rt said:
    Is does not have to do more when i want to contol the lighting if i start a movie, within the flows i can do the filtering if or when i want to swicth on or off lights when i want to watch a movie.
    I had the same wish (and set-up multiple flows with Kodi) and this has been working like a charm for the past couple of months. The only thing that was bugging me was that when I used my set top box to watch normal TV, or via the chrome cast, the lights didn't work. So I solved it with a power meter socket (like Fibaro wall socket or aeontech). Two flows that do the trick now: when power consumption > 20 set variable 'watching tv' to true (this toggles my lights, and keep them on even if there is no motion in the room) and when power consumption < 20 set 'watching tv' to false (which in turn let the lights behave normally on motion again). Works like a charm :)

    Hope it helps.
  • B3rt said:
    olive said:
    Hi @EvertorN

    With the latest update 1.7.0 i have a problem, when homey connect to kodi or shutdown and homey says something, it says 14-15 times again again and again, can you look into this? And can you make a trigger when kodi ends.

    Thanks and Cheers
    i confirm this, all commands in the 'then' statement are performed muti times
    Hi @EvertorN

    The problem is still there with the latest update :'(
  • @olive
    I tried to reproduce the problem but I couldn't. Could you send me the  log and tell me the steps to reproduce this issue? Does disabling and re-enabling the app solve it? 
Sign In or Register to comment.