dnpwwo / domoticz-kodi-plugin Goto Github PK
View Code? Open in Web Editor NEWFull version of Kodi Python Plugin for Domoticz home automation
License: MIT License
Full version of Kodi Python Plugin for Domoticz home automation
License: MIT License
Hi Kodi plugin with the new March 8 beta of Domoticz no longer works
Domoticz Version: 4.9960
Build Hash: 3974b5c4
Compile Date: 2018-08-29 11:43:56
dzVents Version: 2.4.7
Python Version: 3.6.4
GCC 6.3.0 20170516
Got this error in logs Kodi Plugin version:
2018-08-29 14:40:49.916 (Kodi) Unhandled exception in onHeartbeat, forcing disconnect.
2018-08-29 14:40:49.916 (Kodi) Device has disconnected
Did a update and manual select NONE at debug selection. Because this was empty.
After update the error is gone. Maybe a bug in script that is select always NONE if it is not change?
Use Phyton 3.7.0 after a full reinstall of Domoticz. I see this error now.
Used 3.6.4 Phyton before without errors.
2018-08-28 20:58:22.293 Status: (Kodi) Started.
2018-08-28 20:58:22.495 Status: (Kodi) Entering work loop.
2018-08-28 20:58:22.496 Status: (Kodi) Initialized version 2.4.3, author 'dnpwwo'
2018-08-28 20:58:22.507 (Kodi) Update 9:'Screensaver' (Kodi - Status)
2018-08-28 20:58:22.514 (Kodi) Update 10:'10' (Kodi - Source)
2018-08-28 20:58:22.520 (Kodi) Update 2:'100' (Kodi - Volume)
2018-08-28 20:58:22.525 (Kodi) Update 0:'0' (Kodi - Playing)
2018-08-28 20:58:22.576 (Kodi) Connected successfully to: 192.168.100.22:9090
2018-08-28 20:58:22.627 Error: (Kodi) 'onMessage' failed 'AttributeError':''dict' object has no attribute 'decode''.
2018-08-28 20:58:22.627 Error: (Kodi) ----> Line 632 in '/home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py'
2018-08-28 20:58:22.627 Error: (Kodi) ----> Line 144 in '/home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py'
2018-08-28 20:58:22.627 Error: (Kodi) 'onMessage' failed 'AttributeError':''dict' object has no attribute 'decode''.
2018-08-28 20:58:22.628 Error: (Kodi) ----> Line 632 in '/home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py'
2018-08-28 20:58:22.628 Error: (Kodi) ----> Line 144 in '/home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py'
2018-08-28 20:58:22.678 Error: (Kodi) 'onMessage' failed 'AttributeError':''dict' object has no attribute 'decode''.
2018-08-28 20:58:22.678 Error: (Kodi) ----> Line 632 in '/home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py'
2018-08-28 20:58:22.678 Error: (Kodi) ----> Line 144 in '/home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py'
When audio is played, the screensaver becomes active after 5 minutes. This is fine, since the connected screen is off during audio play anyway. However within Domoticz my script goes haywire, since the screensaver status is in this case not the indication that Kodi is idling (reason to shut down my receiver).
To make it worse, the next played song will put the Kodi - Status device back to 'Audio' and keeps doing so until it reaches the end of the album and displays 'On' instead. For me I don't know when the user is active in the GUI or not, making it impossible for me to decide when to shutdown the receiver.
Therefore, can you please update the plugin to do a regular call to Kodi whether the Kodi status is internally 'Idle' while the displayed status is 'On', since the 'Idle' state is handled correctly. I used the kodi add-on Callbacks for that (even @ onIdle), but this add-on makes Kodi very unstable.
UPDATE: I continued my search and with help of dzVents I am able to bypass the described problem in a script.
I think it is a flaw in the current plugin that wen the GUI status update goes to "sleeping", or "screensaver" (don't know how it is called from Kodi) to conclude that everything is stopped. Of course this is true for Video, but not for Audio. Therefore the Kodi - Status device should keep it's status of 'Audio' in that case + Kodi - Playing should continue it's percentage and not go to 'Off'
I now check during a status change to 'Sleeping' this:
{"jsonrpc":"2.0","method":"XBMC.GetInfoBooleans","params":{"booleans":["Player.HasAudio"]},"id":1}
If yes, I try to update the Kodi - Status device to 'Audio (5), although I am not very successful doing so (I can't do it 'silent', so the correction triggers my script again) and I can't update the playing song, since I don't know how to pass this on to the device.
When the status at the end of playing audio switches to 'On', I run this:
{"jsonrpc":"2.0","method":"XBMC.GetInfoBooleans","params":{"booleans":["System.ScreenSaverActive"]},"id":1}. If yes, I try to update the status of Kodi - Status to 'Sleeping' (9)
Hi,
Today decided to update the plugins. One of them is your kodi plugin. After git pull and domoticz restart there is this error:
2018-04-05 20:50:36.579 (Kodi) Entering work loop.
2018-04-05 20:50:36.580 (Kodi) Initialized version 2.5.6, author 'dnpwwo'
2018-04-05 20:50:37.674 Error: (Kodi) 'onStart' failed 'ValueError':'invalid literal for int() with base 10: 'null''.
2018-04-05 20:50:37.674 Error: (Kodi) ----> Line 626 in /home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py, function onStart
2018-04-05 20:50:37.674 Error: (Kodi) ----> Line 93 in /home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py, function onStart
All fields in plugin settings are filled.
Can you have a look what is wrong ?
Latest kodi(osmc)
Latest Domoticz beta
Latest Plugin.
Source selector behaviour
Selected - Choosen
Off - Stops blayback goes to Home, OK
Video - Music
Music - Tv-Shows
Tv-Shows - No change (probably tries Live tv that i don't have)
Live-Tv - Pictures
Log says whats selected but kodi shows wrong item.
Hi
I installed it at Domoticz. and i see is something is playing, On etc..
But i cannot see if im watching a livestream or a movie
I want a trigger if im wachting a movie , so my light can be switch automatically blue. And when im watching livestream the lights should not be controlled
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.