Page 4 of 5

Re: Python Plugin: Spotify

Posted: Saturday 02 March 2019 18:52
by Lanr
PeterFleur wrote: Friday 25 January 2019 18:04
assenzuid wrote: Sunday 30 December 2018 0:02 Get this errpr

Code: Select all

Error calling 'http://localhost:8081/json.htm?vvalue=&vname=Spotify-refresh_token&vtype=2&param=saveuservariable&type=command'
I have exactly the same error.
It looks like the string of the Code part is too long for the user variables. So it cannot be stored there

Anybody resolved this?

Peter
I have exactly the same error. What is the solution for this. Please help. Have tried everything but found no solution! Thanx

René

Re: Python Plugin: Spotify

Posted: Saturday 02 March 2019 20:05
by PeterFleur
Lanr wrote:
PeterFleur wrote: Friday 25 January 2019 18:04
assenzuid wrote: Sunday 30 December 2018 0:02 Get this errpr

Code: Select all

Error calling 'http://localhost:8081/json.htm?vvalue=&vname=Spotify-refresh_token&vtype=2&param=saveuservariable&type=command'
I have exactly the same error.
It looks like the string of the Code part is too long for the user variables. So it cannot be stored there

Anybody resolved this?

Peter
I have exactly the same error. What is the solution for this. Please help. Have tried everything but found no solution! Thanx

René
I've deleted all user variables and reinstalled the plugin. Now it all seems to work.

Peter

Sent from my SM-G930F using Tapatalk


Re: Python Plugin: Spotify

Posted: Sunday 03 March 2019 17:46
by Lanr
Thank you for the quick response Peter.

Have, as you say, discarded all user variables in the Domoticz Spotify plug-in. I also thrown away the installation of the plug-in in the folder "/volume1/@appstore/domoticz/var /plugins/domoticz-spotify-master".
I have placed a downloaded (clean) version afterwards.
User variables are re-entered and the plugin is started, but now (still) the log file is displaying: "Error: (Spotify) Error calling" http: // localhost: 8084 / json.htm? Vvalue = & param = saveuservariable & type = command & vtype = 2 & vname = Spotify-refresh_token ".

Log:

Code: Select all

2019-03-03 19:30:15.687 (Spotify) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2019-03-03 19:30:15.687 (Spotify) Calling domoticz API: http://localhost:8084/json.htm?param=getuservariables&type=command
2019-03-03 19:30:15.688 (Spotify) Add authentification for user: XXXXXXX
2019-03-03 19:30:15.697 (Spotify) User Variable retrievaldate,refresh_token,access_token,searchTxt does not exist. Creation requested
2019-03-03 19:30:15.697 (Spotify) Calling domoticz API: http://localhost:8084/json.htm?vvalue=&param=saveuservariable&type=command&vtype=2&vname=Spotify-retrievaldate
2019-03-03 19:30:15.697 (Spotify) Add authentification for user: XXXXXXX
2019-03-03 19:30:15.434 Status: (Spotify) Started.
2019-03-03 19:30:15.644 Status: (Spotify) Entering work loop.
2019-03-03 19:30:15.645 Status: (Spotify) Initialized version 0.2, author 'djj'
2019-03-03 19:30:15.699 Error: (Spotify) Error calling 'http://localhost:8084/json.htm?vvalue=&param=saveuservariable&type=command&vtype=2&vname=Spotify-retrievaldate' 
Are there any other tips on how I can solve this?

Please HELP, René

Re: Python Plugin: Spotify

Posted: Sunday 10 March 2019 15:49
by PeterFleur
Hmm it looks like i answered in the wrong plugin. My chromecast started working after deleting the user variables. Spotify is not working for me. I think the cause is the length of the API key Spotify generates. The key is too long to store in the user variables.

Peter

Re: Python Plugin: Spotify

Posted: Wednesday 24 April 2019 21:56
by Tobbo
Can't seem to get this plugin to work anymore. It worked fine a few months ago but now I'm getting this error message.

Code: Select all

(SpotifyPlugin) Error calling 'http://localhost:8080/json.htm?vtype=2&vvalue=&param=saveuservariable&type=command&vname=SpotifyPlugin-retrievaldate'
I'm not sure if the problem is related to me updating Domoticz to beta version. Any ideas?

Re: Python Plugin: Spotify

Posted: Thursday 09 May 2019 14:44
by cdv4
Egregius wrote: Wednesday 04 July 2018 7:44 Hi, I'm having troubles retrieving the code. After entering the code I get this in the logfile:

Code: Select all

Error: (Spotify) Bad request to spotify, code entered in hardware parameters could one be used once. Please get a new one
Any ideas?
make sure the redirect URI you're using is exactly http://localhost , not http://localhost/ or anything else.. I was having the same problem because I kept putting the wrong redirect.

Re: Python Plugin: Spotify

Posted: Thursday 09 May 2019 15:01
by Egregius
Thanks for the reply, I'm not using this anymore.
Since I have several Bose Soundtouch speakers I can control everything thru them.

Re: Python Plugin: Spotify

Posted: Wednesday 10 July 2019 10:22
by vodor
Giving your plugin a try. I was looking for something like this.
Unfortunately I am stuck with the following errors in my log.
It's also worth noting that the variables did not create themselves. So I manually created them all (as strings). This got past the error for not finding spotify-refresh_token

I am sure the error below might be related to manually creating these variables. Any ideas?

2019-07-10 10:17:45.861 Error: (spotify) Seems something with wrong with token response from spotify
2019-07-10 10:17:46.162 (spotify) JSON Returned from spotify listed available devices: None
2019-07-10 10:17:46.160 Error: (spotify) Unkown error: code: 401, msg: ()
2019-07-10 10:17:46.162 Error: (spotify) 'onStart' failed 'TypeError':''NoneType' object is not subscriptable'.
2019-07-10 10:17:46.162 Error: (spotify) ----> Line 491 in '/home/pi/domoticz/plugins/spotify/plugin.py', function onStart
2019-07-10 10:17:46.162 Error: (spotify) ----> Line 99 in '/home/pi/domoticz/plugins/spotify/plugin.py', function onStart
2019-07-10 10:17:46.162 Error: (spotify) ----> Line 110 in '/home/pi/domoticz/plugins/spotify/plugin.py', function checkDevices
2019-07-10 10:17:46.162 Error: (spotify) ----> Line 141 in '/home/pi/domoticz/plugins/spotify/plugin.py', function buildDeviceSelector
2019-07-10 10:17:55.665 (spotify) Pushing 'onHeartbeatCallback' on to queue
2019-07-10 10:17:55.687 (spotify) Processing 'onHeartbeatCallback' message
2019-07-10 10:17:55.687 (spotify) Calling message handler 'onHeartbeat'.

Re: Python Plugin: Spotify

Posted: Friday 19 July 2019 10:06
by Eraser78
Same here, plugin worked fine for months
Since 11/07 I get errors.
I reinstalled the plugin but no solution
Errors:
2019-07-19 09:26:44.423 (Spotify) Pushing 'onHeartbeatCallback' on to queue
2019-07-19 09:26:44.443 (Spotify) Processing 'onHeartbeatCallback' message
2019-07-19 09:26:44.443 (Spotify) Calling message handler 'onHeartbeat'.
2019-07-19 09:26:44.444 (Spotify) Polling
2019-07-19 09:26:44.444 Error: (Spotify) 'onHeartbeat' failed 'ValueError'.
2019-07-19 09:26:44.444 Error: (Spotify) ----> Line 495 in '/home/pi/domoticz/plugins/spotify/plugin.py', function onHeartbeat
2019-07-19 09:26:44.444 Error: (Spotify) ----> Line 404 in '/home/pi/domoticz/plugins/spotify/plugin.py', function onHeartbeat
2019-07-19 09:26:44.444 Error: (Spotify) ----> Line 369 in '/home/pi/domoticz/plugins/spotify/plugin.py', function spotCurrent
2019-07-19 09:26:44.444 Error: (Spotify) ----> Line 160 in '/home/pi/domoticz/plugins/spotify/plugin.py', function spotGetBearerHeader

It seems like the user variables are not filled correctly anymore

Re: Python Plugin: Spotify

Posted: Sunday 21 July 2019 12:19
by Eraser78
Works again after update to Domoticz V4.11022

Re: Python Plugin: Spotify

Posted: Monday 22 July 2019 8:52
by vodor
Also tried an upgrade to latest 4.11 beta like Eraser78 but the problem still persists for me :-(
I will maybe try uninstall and retry the install process now that I am on 4.11 and see how that goes.

2019-07-22 08:47:56.371 Status: (spotify) Started.
2019-07-22 08:47:57.128 (spotify) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2019-07-22 08:47:57.128 (spotify) Calling domoticz API: http://localhost:8080/json.htm?param=ge ... pe=command
2019-07-22 08:47:57.132 (spotify) Add authentification for user: admin
2019-07-22 08:47:57.169 (spotify) {'Name': 'spotify-retrievaldate', 'Type': '2', 'idx': '40', 'LastUpdate': '2019-07-10 09:56:41', 'Value': '1'}
2019-07-22 08:47:57.169 (spotify) {'Name': 'spotify-access_token', 'Type': '2', 'idx': '39', 'LastUpdate': '2019-07-10 10:15:58', 'Value': '1'}
2019-07-22 08:47:57.169 (spotify) {'Name': 'spotify-refresh_token', 'Type': '2', 'idx': '38', 'LastUpdate': '2019-07-10 10:17:21', 'Value': '2'}
2019-07-22 08:47:57.170 (spotify) {'Name': 'spotify-searchTxt', 'Type': '2', 'idx': '41', 'LastUpdate': '2019-07-10 09:56:57', 'Value': 'Lindsey'}
2019-07-22 08:47:57.170 (spotify) Checking if devices exist
2019-07-22 08:47:57.170 (spotify) Spotify devices selector does not exist, creating device
2019-07-22 08:47:57.170 (spotify) Token expired, getting new one using refresh_token
2019-07-22 08:47:57.170 (spotify) For basic headers using client_id: xxxxxxxxxxxxxxxxxxxxxxx, client_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-07-22 08:47:57.122 Status: (spotify) Entering work loop.
2019-07-22 08:47:57.123 Status: (spotify) Initialized version 0.2, author 'djj'
2019-07-22 08:47:57.881 Error: (spotify) Seems something with wrong with token response from spotify
2019-07-22 08:47:57.973 Error: (spotify) 'onStart' failed 'AttributeError'.
2019-07-22 08:47:57.973 Error: (spotify) ----> Line 491 in '/home/pi/domoticz/plugins/spotify/plugin.py', function onStart
2019-07-22 08:47:57.974 Error: (spotify) ----> Line 99 in '/home/pi/domoticz/plugins/spotify/plugin.py', function onStart
2019-07-22 08:47:57.974 Error: (spotify) ----> Line 110 in '/home/pi/domoticz/plugins/spotify/plugin.py', function checkDevices
2019-07-22 08:47:57.974 Error: (spotify) ----> Line 127 in '/home/pi/domoticz/plugins/spotify/plugin.py', function buildDeviceSelector
2019-07-22 08:47:57.974 Error: (spotify) ----> Line 181 in '/home/pi/domoticz/plugins/spotify/plugin.py', function spotDevices

Re: Python Plugin: Spotify

Posted: Tuesday 30 July 2019 23:19
by pvklink
it is def. a problem with the domoticz uservariables!
i created a user variable and tried to cut and paste my spotify code in it, and i get an error...
thats why the plugin cant create the uservars...
my code =
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is this big !!!

Re: Python Plugin: Spotify

Posted: Tuesday 17 September 2019 15:40
by wiho
On the problem of the user variables not being created.
saveuservariable doesn't exit anymore, see the Domoticz API.
Change in plugin.py the following in the method getUserVar(self) on line 209 :

Code: Select all

  DomoticzAPI({"type": "command", "param": "adduservariable",
                                     "vname": Parameters["Name"] + '-' + variable, "vtype": "2", "vvalue": ""})
So change saveuservariable into adduservariable
Maybe the developer can update this in his code on git to.

Re: Python Plugin: Spotify

Posted: Monday 11 November 2019 22:48
by jaaap
wiho wrote: Tuesday 17 September 2019 15:40 On the problem of the user variables not being created.
saveuservariable doesn't exit anymore, see the Domoticz API.
Change in plugin.py the following in the method getUserVar(self) on line 209 :

Code: Select all

  DomoticzAPI({"type": "command", "param": "adduservariable",
                                     "vname": Parameters["Name"] + '-' + variable, "vtype": "2", "vvalue": ""})
So change saveuservariable into adduservariable
Maybe the developer can update this in his code on git to.
Thank you so much for this! I overlooked your comment the first time and spent all night trying to get it to work. But thanks to your comment I got it working. Thanks!

Re: Python Plugin: Spotify

Posted: Monday 11 November 2019 22:52
by jaaap
So I've played around with this plugin, and it is very nice!

However, I'm still looking for some extra functionality. I would like to be able to select pauze, play, next song in domoticz. This way, I can connect it to my Xiaomi Magic Cube. I know it is working in Dashticz, but I was wondering if someone knows a way to make it work in Domoticz as well? (or in any other way it can connect to the magic cube).

Re: Python Plugin: Spotify

Posted: Tuesday 12 November 2019 6:49
by renerene
Just found this thread.
Question: can this script be used to start playlist A in random order on device B by just turning on some dummy switch?

Re: Python Plugin: Spotify

Posted: Sunday 16 February 2020 14:54
by zabinskiwojciech
Hello
I have a problem with this plugin.
Spotify account I have Premium.
How do I paste a link with my ID, of course:
https://accounts.spotify.com/authorize? ... back-state
I get a refund on the browser: INVALID_CLIENT: Invalid redirect URI
My Domoticz server is installed on Ubuntu Server so I have no way to issue commands from the browser on the server because I only have CLI
Please help

Re: Python Plugin: Spotify

Posted: Tuesday 18 February 2020 15:37
by zabinskiwojciech
I have already tried all options, I gave the IP address from the LAN of my server I gave the external IP address: Port from WAN and nothing is wrong with this link or I do not know that I need to install some desktop on Linux and from the browser on the server ??

Re: Python Plugin: Spotify

Posted: Wednesday 19 February 2020 15:05
by zabinskiwojciech
I installed a graphical overlay on ubuntu but it also did not help, all the time I got a wrong URI

Re: Python Plugin: Spotify

Posted: Tuesday 17 March 2020 21:41
by zabinskiwojciech
On the Spotify page in Dashboard, I did not add this footnote http: // localhost, I changed my IP address to my server where Domoticz is installed. After this task, a page appeared for approval, I approved and I did not receive the code number with the code. my server page has opened. What am I doing wrong that I don't want to work?