owagner / kodi2mqtt Goto Github PK
View Code? Open in Web Editor NEWMQTT addon for Kodi Mediacenter
MQTT addon for Kodi Mediacenter
Hallo Oliver,
irgendwie spielst du mit den gleichen Sachen rum wie ich. Habe eben nach kodi und mqtt gesucht und schon wieder deine Arbeit gefunden.
Funktioniert perfekt ... und auf Anhieb.
Einen kleinen Erweiterungswunsch hätte ich ... ich nutze das Plugin, um je nach PlayBack State meine Philips Hue zu steuern - allerdings wünsche ich mir eine Unterscheidung nach Musik und Video. Kurz nach dem PlayBack State kommen ja die Details, da steht bei Musik der type:"Song" drin, aber ich brauch den Type im State Packet, eben auch am Ende und bei Pause um das Licht bei Filmen wieder hochzufahren.
Ich hab schon geschaut, ob ich das selber irgendwie reinkriege ... aber Python ist eine der wenigen Sprachen, mit denen ich noch gar nix gemacht habe.
Viele Grüße
Guido
On startup, I have an error about the script (openelec). If I deactivate/reactivate, itworks fine.
My mosquitto broker is on another linux system (mosquitto host and kodi host are bothe wired on the same subnet ie 192.168.1.X).
Log :
22:12:53 T:2961175616 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'socket.gaierror'>
Error Contents: [Errno -2] Name or service not known
Traceback (most recent call last):
File "/storage/.kodi/addons/service.mqtt/service.py", line 227, in
startmqtt()
File "/storage/.kodi/addons/service.mqtt/service.py", line 206, in startmqtt
mqc=mqtt.Client()
File "/storage/.kodi/addons/service.mqtt/lib/client.py", line 422, in init
self._sockpairR, self._sockpairW = _socketpair_compat()
File "/storage/.kodi/addons/service.mqtt/lib/client.py", line 267, in _socketpair_compat
sock1.connect(("localhost", port))
File "/odroid/build.OpenELEC-Odroid.C1.arm-5.0.6/Python-2.7.3/.install_pkg/usr/lib/python2.7/socket.py", line 223, in meth
gaierror: [Errno -2] Name or service not known
-->End of Python script error report<--
22:12:53 T:3043337152 DEBUG: ------ Window Init (DialogKaiToast.xml) ------
22:12:54 T:3043337152 DEBUG: ------ Window Deinit (Pointer.xml) ------
22:12:54 T:2961175616 INFO: Python script stopped
Works not anymore in Kodi 19
The adapter doesn't currently support TLS. Paho supports this by using a CA certificate to authenticate and encrypt to a broker.
A client certificate pair can also be used to authenticate to some brokers, would be great to support that as well.
Hi Oliver!
Great job with the addon, works great and it's an easy way to integrate Kodi with any system that speaks Mqtt. Congratulations!
I don't know if I'm the only one, but in my Kodi installation (custom made HTPC with Libreelec) the addon doesn't work after resuming the machine from the suspend state (S3). It doesn't publish the "connected" message and I don't see no message being published when some video is played. Is it a normal behavior? If it's not, I will try to collect some useful debug log files for you.
Many again for your help and keep up with the great work.
Best regards,
Aitor
Thank you for your great addons, and sorry for my bad english.
Im trying to get whats currently playing and the time of whats playing, so i can push that to a temporary variable into my mqtt server, play some google TTS into kodi and then resume where i was
Do you know how to push all that into json ?
Example:
{"kodi_details": {"title": "Young Atlas", "fanart": "image://http%3a%2f%2fthetvdb.com%2fbanners%2ffanart%2foriginal%2f318201-3.jpg/", "id": 4216, "file": "smb://DATA/TV/Serie/Trollhunters/Season 1/Trollhunters - S01E10 - Young Atlas.mkv", "label": "Young Atlas", "type": "episode", "thumbnail": "image://http%3a%2f%2fthetvdb.com%2fbanners%2fepisodes%2f318201%2f5892231.jpg/", "streamdetails": {"video": [{"stereomode": "", "width": 1280, "codec": "h264", "aspect": 1.7777780294418335, "duration": 1333, "height": 720}], "audio": [{"channels": 2, "codec": "ac3", "language": ""}], "subtitle": []}}, "val": "Young Atlas"}
{"kodi_time": "00:00:12", "kodi_totaltime": "00:22:13", "val": "1.0"}
Im trying with Mosquitto publish but cannot seems to put all those togeter :-/
hope my question is clear ?
And thank you for the Hand !
Hello is it possible to get the search results back in Addons? (for example Youtube addon)
Also to initiate playing of a clip in the addon for example.
It would be great to combine the colour sampling features of the Kodi Hue plugin into this and publish to a topic.
I have an app that continuously monitors what’s happening on my KODI (17.6).
When watching TV, listening to music or radio streams, there is no title upgrade when the titles change (KODI shows it properly on all three situations). The progress works correctly (i.e., jumps to zero and shows new duration).
This means, my MQTT app only gets the FIRST title whenever you started TV, music or radio, and it never gets updated.
Could this be repaired, please?
Hi,
First of all, great work with the add-on for Kodi.
I have a Flirc receiver in my kodi with libreelec (pi3) and it would be great if I could send specific keyboard inputs (in this case remote inputs) via MQTT to give commando's to my home automation. In this case I could use my remote to switch on lights etc. One free key in kodi for instance is 'g', which I connect to the blue button on my remote.
Thanks for all your work.
Running on Android 9.0.0, kodi 18.3, NVIDIA Shield
No payload is published when an initial play of an item is triggered.
When item is paused a message is published ("kodi_state": "paused")
And all details is published when resuming that same item ("kodi_state": "resumed")
progress is published even if the initial play is not published
When new item is started from a paused old item, the correct playbackstate is published. And "kodi_state": "started" as expected
However, I do not have this issue on Kodi 18.3-RC1 on RPI - so maybe an issue in detecting player state on Android?
Hi,
i have a new kodi box and installed version 0.12 of your addon. The playbackstate topic does not include playertype any more, allthough the documentations says it should be there.
{ "topic": "kodi/status/playbackstate", "payload": "1", "qos": 0, "retain": false, "_msgid": "b5aa43f0.4a55c" }
Did i miss something?
In the kodi_details we get the info about if it is a movie or episode, but when playing an episode, I would like to also get the title of the tv series playing, and season and episode number.
As it is right now, there is only info about what the episode name is.
Hi,
When I connect my kodi box (Rpi) to my TV, it connects via the HDMI ARC. If I press the volume up/down command on the keyboard that would normally change the GUI volume circle on Kodi, it goes via ARC to the TV volume instead, this work perfectly.
However, if I send the volume up/down to Kodi via the MQTT, is changed the volume within Kodi only, it does not behave as the keys do.
Can this be changed to work as per the keys? This would be very useful..
@owagner
Firstly, I would like to thank you for this addon, it is making my home automation interact with my TV finally possible. It seems to be working flawlessly.
Im wondering if theres a way to get kodi to send the selected channel to mqtt. I have a library built with IR codes for my satellite that i can call from mqtt.
If kodi was able to send "kodi/123" through mqtt when I select channel "123" through the guide or channel list - I would be able to port that through to my IR tranceiver bridge and actually change the channel. If this is something you could implement I would be forever grateful.
Thanks in advance.
From http://forum.kodi.tv/showthread.php?tid=222109&pid=1980508#pid1980508
"Could you allow hostname as input for the server instead of only IP address? "
Possible to add Volume Control?
Seems possible with Application.SetVolume RPC method.
I personally need Volume+ and Volume- commands, but vanilla Volume set with percentage parameter will be just fine.
Thanks!
Hi,
I am not sure if its just because of my setup, but when I play video files that are not indexed in the Kodi library, the mqtt topic will only show the last played indexed file and appear "stopped".
Can you confirm this? I will try to find where it happens in the code.
Do you know if the add on will work if Kodi is loaded on my Amazon Fire device? The requirement for Eclipse Paho for Python I am guessing is not installed on the Amazon fire device.
Hallo Oliver,
danke, dass du dich der Änderung angenommen hast. Ich bekomme mit der neuen Version allerdings gar keinen Playback State mehr, beim Starten einer Datei :(
Folgende Meldungen erhalte ich nun:
{"kodi_playbackdetails": {"subtitleenabled": true, "currentaudiostream": {"index": 0, "name": "Stereo", "language": "und", "channels": 2, "codec": "aac", "bitrate": 0}, "repeat": "off", "currentsubtitle": {}, "speed": 1}, "kodi_state": "started", "kodi_playertype": "video", "val": 1, "kodi_playerid": 1}
30.7.2015, 06:40:51[9773c75.f688c38]
kodi/status/title : [msg.payload] : string
{"kodi_details": {"title": "", "streamdetails": {"video": [{"stereomode": "", "width": 720, "codec": "avc1", "aspect": 1.25, "duration": 65, "height": 576}], "audio": [{"channels": 2, "codec": "aac", "language": "und"}], "subtitle": []}, "type": "unknown", "file": "smb://QNAP/Multimedia/video/Kurzfilme/BMW/An_old_trick_performed_by_the_BMW_S_1000_RR.mp4", "label": "An_old_trick_performed_by_the_BMW_S_1000_RR.mp4"}, "val": ""}
30.7.2015, 06:40:51[9773c75.f688c38]
kodi/status/progress : [msg.payload] : string
{"kodi_time": "00:00:00", "kodi_totaltime": "00:01:05", "val": 0.29999999999999999}
Am Ende kommt allerdings der Status:
{"kodi_state": "ended", "kodi_playertype": "video", "val": 0, "kodi_playerid": 1}
Playing with the MQTT Adapter and the logging seems pretty noisy by default.
Pull request #8 gives the user a choice as to whether they want all the additional logging for debug purposes. It's not granular, so a simple on or off setting in the addon itself.
It would be good if you could add a GUI menu button within kodi UI somewhere, which could then send a command.
For example,
A button in the kodi screen menu somewhere called "Turn light on/off" which would sent the appropriate;
cmnd/lights/POWER
Anyone able to do this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.