v18 Kodi Voice with PVR Functions - Leia v18
#1
As I mainly use Kodi as a Live PVR player, along with access to a few addons, music and films, I noticed a number were also looking for PVR functions as part of Kanzi, kodi voice or the alexa video skill.

I have created a PVR fork from the latest Kanzi master working on Leia 18. This is tried and tested on latest millhouse build of libreelec with TVH PVR client and backend.

There is no obvious intention to merge PVR into Kanzi master which is a shame but this fork then gives users the best of both worlds with an alternative functioning fork if they wish to use PVR functions as part of the alexa voice control.

I have tried to make the setup process as easy as possible but it is not using the current Kanzi deploy method as we need to edit the deployed files. I have re written the readme to reflect the process and also the latest developer console actions.

Github Repos: 

https://github.com/fb42000/kanzi   

https://github.com/fb42000/kodi-voice

**UPDATE**  22/12/18 - following this PR into v18 master 15093 (PR), skill now includes ability to start/stop recordings by channel name or programme. [kodi.py]  updated in repo -

Any comments warmly welcomed, any questions may be a little harder as this is just a trial project of mine but happy to share those learnings
Main Kodi System -Acer Revo 3600 1.6GHz Intel Atom 230  - Sundtek S2 USB, 3x August DVB-T210 - Milhouse nightly LibreELEC - Modified Mimic Skin - Modified Kanzi PVR Voice Control
Other devices - Raspberry Pi 2 milhouse libreelec Leia v18
Laptop - Lenovo Ideapad 510 - Xubuntu Bionic 18.04
Reply
#2
Hello fb42000

I also use my Kodi instances around the home to watch Sat TV. So when you posted that you have adapted the work of others to implement a PVR function with Alexa, I was pleased and excited to try it out. I've followed your intructions and managed to get all the hard configuration out of the way.

Where I am unable to progress any further is at the Alexa Developer Console. At the JSON editor after inserting the IntentSchema.json and amending the invocation name (the provided schema already had "telly" as the name).

When saving the model, I'm presented with the same error as in the picture on your instructions page "Custom type values must not be empty" I'm unable to leave this page and no slots or intents are populated. Any ideas on how to resolve this? Any attempt to move away from this page and the JSON code is lost.

Thanks.
Reply
#3
@cdebellis 

Thanks for pointing this out - i must have gone a bit too mad removing my own custom slots that I left the intent schema in my repo with no custom slot values Wink  - hence why you are stuck in the cannot save loop.

I have updated the intentschema here https://github.com/fb42000/kanzi/blob/ma...chema.json which includes an "empty" to each custom slot value (these can be left when you populate each slot type with your own or alter or delete them once you have populated with your own.

I have tried this out  on a new skill setup and save is OK now so you should be able to move on

Let me know how you get on
Main Kodi System -Acer Revo 3600 1.6GHz Intel Atom 230  - Sundtek S2 USB, 3x August DVB-T210 - Milhouse nightly LibreELEC - Modified Mimic Skin - Modified Kanzi PVR Voice Control
Other devices - Raspberry Pi 2 milhouse libreelec Leia v18
Laptop - Lenovo Ideapad 510 - Xubuntu Bionic 18.04
Reply
#4
Hey,

i would like to try it, but if i have a running version of https://lexigr.am do i only have to install:

pip install kodi-voice

of what do i have to do to get it working?

thanks

Edit: found the readme
Reply
#5
Thanks for this PVR fork of Kanzi. I just tried it as I use Live TV a lot and it works great for PVR. But the other functions seem to crippled: not finding half of my tv shows or movies. Plays only random episodes. Not plying specific season episode of tv show, etc. Is there anything obvious that I have messed during set up process?
Reply
#6
(2018-12-31, 01:00)nhsman Wrote: Thanks for this PVR fork of Kanzi. I just tried it as I use Live TV a lot and it works great for PVR. But the other functions seem to crippled: not finding half of my tv shows or movies. Plays only random episodes. Not plying specific season episode of tv show, etc. Is there anything obvious that I have messed during set up process?
Thanks for the feedback -

Have you populated all the slot values with your all your movies and tv shows - those parts were not altered from kanzi master as the PVR requests were added to the existing -- Make sure you update your library within Kodi , the web app only generates 100 items so you may need to manually add any more or run 'generate_custom_slots.py' - copy to your site packages folder to stop it complaining - you will also need to paste a copy of your kodi.config to the same location to run it then bulk import the results into the Alexa Developer Console overwriting your current slot values. You will then need to re build the skill before testing / using - I have uploaded a revised version of above .py to my repo as i now have it working with newer name recognition within kanzi.

Have a play also with settings within the kodi.config from Line 37 for max results (change the figures <> at Lines 45-47, and from Line 74(change the figure <> at Line 79); and note also the statement on Line 8

I dont use TV shows based on episode etc but my movies is quick to respond and start playing
Main Kodi System -Acer Revo 3600 1.6GHz Intel Atom 230  - Sundtek S2 USB, 3x August DVB-T210 - Milhouse nightly LibreELEC - Modified Mimic Skin - Modified Kanzi PVR Voice Control
Other devices - Raspberry Pi 2 milhouse libreelec Leia v18
Laptop - Lenovo Ideapad 510 - Xubuntu Bionic 18.04
Reply
#7
Thanks for you help. I have copied 'generate_custom_slots.py' and 'kodi.config' to ~/.local/lib/python2.7/site-packages and run it but still get the same errors, can you please advise?
Quote:Traceback (most recent call last):
  File "generate_custom_slots.py", line 112, in <module>
    name_stripped = kodi.sanitize_name(v['label'], True, False)
  File "/home/tvh/.local/lib/python2.7/site-packages/kodi_voice/kodi.py", line 474, in sanitize_name
    return sanitize_name(*args, **kwargs)
TypeError: sanitize_name() takes at most 2 arguments (3 given)

PS. I have found why this skill is not responding to episode queries. In the original skill there are 137 Intents and in PVR fork there are 67 Intents by default at least in my case.
If I copy required intents from original Kanzi skill to PVR fork and rebuild then the skill responses just fine.
So the question: is it possible to include all original Intents from Kanzi in your PVR fork with all the PVR Intents added so there is no need to manually coping them over?

Thank you for the great work.
Reply
#8
" I have copied 'generate_custom_slots.py' and 'kodi.config' to ~/.local/lib/python2.7/site-packages and run it but still get the same errors, can you please advise?"

Please ensure you use the current py uploaded to my repo yesterday - the original one failed - probably why i never initially got on with it in the same way you have experienced - the new one generates all relevant slot sheets - i have also added a channel generator within it which it seems to bring info in OK - alter Line 79 in kodi config to bring in larger libraries

"is it possible to include all original Intents from Kanzi in your PVR fork with all the PVR Intents added so there is no need to manually coping them over?"

Drag and drop the latest version of the IntentSchema in my repo (i have added all the initial intents from Kanzi - i didnt realise how much i had played around before and removed what i dont use), change the invocation name Line 4 to whatever you have chosen, rebuild and let me know if better
Main Kodi System -Acer Revo 3600 1.6GHz Intel Atom 230  - Sundtek S2 USB, 3x August DVB-T210 - Milhouse nightly LibreELEC - Modified Mimic Skin - Modified Kanzi PVR Voice Control
Other devices - Raspberry Pi 2 milhouse libreelec Leia v18
Laptop - Lenovo Ideapad 510 - Xubuntu Bionic 18.04
Reply
#9
Works great now. Thank you.
Reply
#10
One more question:

Is it possible to assign ID (optional) or Synonyms (optional) to the channels. I tried to assign numbers to all my channels in skill builder then save model and build. All went well but when I try to play channel by number Alexa say that can't find it. I tried using numbers and also words like: one, two, three, etc.

Is it even possible?
Reply
#11
I tried initially just adding actual channel numbers to ID or Synonyms associated with the channel name on ADC but the JSON string that gets the channels is not set up to receive the number, rather the name and unique id  - this was going to be next on my list to look further into to see if it was worth it (i forget all my channel numbers:name past 5 anyhow so it wasn't a priority when i first tried!) 

Posting the string 

http://my.kodi.ip.address:port/jsonrpc?request={"jsonrpc": "2.0", "method": "PVR.GetChannels","params":{"channelgroupid": "alltv",  "properties":["channel", "uniqueid", "channelnumber"]},"id": 1}

does return a list of channel names and channel numbers so I shall progress but the kodi intents need changing for either / or (or adding - ie setup another intent for channel name and one for channel number) as they are only associated with what is received as "channel" at present and cannot process two arguments - although possibly a number is a lot more of a wildcard than say a dedicated TV channel name - i shall try it out and post results
Main Kodi System -Acer Revo 3600 1.6GHz Intel Atom 230  - Sundtek S2 USB, 3x August DVB-T210 - Milhouse nightly LibreELEC - Modified Mimic Skin - Modified Kanzi PVR Voice Control
Other devices - Raspberry Pi 2 milhouse libreelec Leia v18
Laptop - Lenovo Ideapad 510 - Xubuntu Bionic 18.04
Reply
#12
@fb42000 

Thanks for resolving this, I'm now up and running after a number of failed deployments with the kanzi function. In the end this has been the hardest part to get functioning. A word of help to others running the commands pip install -r requirements.txt and pip install packaging zappa lambda-packages. Make sure you use an earlier version of pip, version 9.0.3 worked for me. The versions used determine if the lambada function works properly once deployed. Would there be any way we can improve this?

Regards.
Reply
 
Thread Rating:
  • 1 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
Kodi Voice with PVR Functions - Leia v1851