Announcement

Collapse
No announcement yet.

How to trigger a Kodi built in function

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to trigger a Kodi built in function

    Anyone know how I can trigger the built in function called CECTriggerState? I was thinking an event with execute add-on but it is not an add on so I can't get it to work? Any help is appreciated.

    Bryan

  • #2
    I see two possible ways to do that:

    1/ create a simple Kodi script addon in which you call CECToggleState (BTW I think it's CECToggleState not CECTriggerState): http://kodi.wiki/view/HOW-TO:HelloWo...6_JSON-RPC_API).
    Then from HS use the event action "Execute Addon"

    2/ Map a remote key to the CECToggleState function, here is an example: http://forum.kodi.tv/showthread.php?tid=186856. Let's say you map the blue key on your remote.
    Then from HS, use the event action "Input Execute Action", and select "blue"as the action.

    Comment


    • #3
      Originally posted by spud View Post
      I see two possible ways to do that:

      1/ create a simple Kodi script addon in which you call CECToggleState (BTW I think it's CECToggleState not CECTriggerState): http://kodi.wiki/view/HOW-TO:HelloWo...6_JSON-RPC_API).
      Then from HS use the event action "Execute Addon"

      2/ Map a remote key to the CECToggleState function, here is an example: http://forum.kodi.tv/showthread.php?tid=186856. Let's say you map the blue key on your remote.
      Then from HS, use the event action "Input Execute Action", and select "blue"as the action.

      Thank you for your help first of all. I actually tried your second suggestion already but couldn't get it to work. I just tried to use the blue button like your example just in case and still does not work. If I hit the blue button on the physical remote it works so I know the mapping is correct. However if I trigger it from HS event then nothing happens. Here is a screenshot of my event maybe you can see something wrong with it.


      Bryan
      Last edited by Bchenoweth; October 29th, 2016, 09:48 AM.

      Comment


      • #4
        Sorry for the very large image I uploaded it as a 640x480 image not sure what is happening.

        Comment


        • #5
          then I would need to test it on my system, but I don't have much time to do that. Could you try solution #1 instead?

          Comment


          • #6
            I'll read the how to and see if I can figure it out. Never have created a Kodi plugin so I am unfamiliar. I'll see if I can learn.

            Comment


            • #7
              I tried to use option 1 but I obviously have no idea what I am doing with scripting I thought I had it figured out but everytime I try to install the addon in Kodi it gets installation failed right away. I am posting it here to see if anyone can see a problem with the script that knows what they are doing.

              Spud I know you are busy so I understand if you do not have the time for this. I am hoping someone else may be able to lend a hand.
              Attached Files

              Comment


              • #8
                in addon.xml set id="script.cectogglestate"

                then on your Kodi machine in C:\Users\<your user name>\AppData\Roaming\Kodi\addons

                create a directory called script.cectogglestate, then copy all your addons files into it.
                start Kodi to your Program add-ons and try to run the "Toggle TV Power" addon

                Comment


                • #9
                  Another update. When going into Kodi's program add ons menu and running the TV Power Toggle from within the menu it turns the TV off as expected.

                  When running the homeseer event below nothing happens.

                  I am puzzled as to why nothing seems to be working from within homeseer but is working direct from remote or within kodi. Any ideas?
                  Attached Files

                  Comment


                  • #10
                    Nevermind, got it mostly. Found my fat fingers left the c out in script in the XML file. That is why it didn't work. Working now to turn off but not on. Will play with some other commands and try.

                    Comment

                    Working...
                    X