Example Home Assistant Configs, home-assistant.io
Tested with version 0.73
More custom components: https://github.com/Danielhiversen/home-assistant_custom_components
Example Home Assistant Configs
Example Home Assistant Configs, home-assistant.io
Tested with version 0.73
More custom components: https://github.com/Danielhiversen/home-assistant_custom_components
Thank you for putting this together and sharing it.
I'm using your script along with an RFID-reader arrangement that @hovee shared here:
https://community.home-assistant.io/t/google-music-in-ha/10976/120?u=mttsmmrssprks
I almost have things working but when my Home Assistant attempts to connect to Google Play Music, I get the following error messages. Do you know what might be causing these?:
2018-05-12 23:26:07 ERROR (Thread-12) [custom_components.switch.gmusic] Failed to get track (GetStreamUrl: 403 Client Error: Forbidden for url: https://mclients.googleapis.com/music/mplay?sig=vdOiAlx-fd5JvMh7K2hFn0t0HZA&net=mob&opt=hi&tier=fr&dv=0&hl=en_US&pt=e&songid=c0f673e1-2ceb-3873-b579-12c74708f4b1&slt=1526167567609
(requests kwargs: {'method': 'GET', 'headers': {'Authorization': '<omitted>', 'X-Device-ID': 'iosB71B204E-F6EA-43D7-B1DB-29ECFFA8ABBF'}, 'allow_redirects': False, 'url': 'https://mclients.googleapis.com/music/mplay', 'params': {'sig': b'vdOiAlx-fd5JvMh7K2hFn0t0HZA', 'net': 'mob', 'opt': 'hi', 'tier': 'fr', 'dv': 0, 'hl': 'en_US', 'pt': 'e', 'songid': 'c0f673e1-2ceb-3873-b579-12c74708f4b1', 'slt': '1526167567609'}})
(response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n'))
2018-05-12 23:26:07 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: message=Failed to get track (GetStreamUrl: 403 Client Error: Forbidden for url: https://mclients.googleapis.com/music/mplay?sig=vdOiAlx-fd5JvMh7K2hFn0t0HZA&net=mob&opt=hi&tier=fr&dv=0&hl=en_US&pt=e&songid=c0f673e1-2ceb-3873-b579-12c74708f4b1&slt=1526167567609
(requests kwargs: {'method': 'GET', 'headers': {'Authorization': '<omitted>', 'X-Device-ID': 'iosB71B204E-F6EA-43D7-B1DB-29ECFFA8ABBF'}, 'allow_redirects': False, 'url': 'https://mclients.googleapis.com/music/mplay', 'params': {'sig': b'vdOiAlx-fd5JvMh7K2hFn0t0HZA', 'net': 'mob', 'opt': 'hi', 'tier': 'fr', 'dv': 0, 'hl': 'en_US', 'pt': 'e', 'songid': 'c0f673e1-2ceb-3873-b579-12c74708f4b1', 'slt': '1526167567609'}})
(response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n')), source=custom_components/switch/gmusic.py, exception=, timestamp=1526167567.7296267, level=ERROR>
The error messages above always seem to be preceded by this series of issues I get when I first start Home Assistant and after I pass the value of a playlist to it.
2018-05-12 23:26:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=turn_on, domain=switch, service_data=entity_id=['switch.google_music'], service_call_id=1975722832-26>
{'absolutePosition': '01937889337530657663', 'creationTimestamp': '1523577235365678', 'trackId': 'be2d5142-4ec8-35e8-8daa-e0569448b784', 'id': 'c2d9d78d-ef1a-31e2-af95-126948da0caf', 'lastModifiedTimestamp': '1523577235365678', 'kind': 'sj#playlistEntry', 'source': '1', 'playlistId': '9142d3a3-3d2d-4da3-9361-a84a4df2f2be', 'clientId': '77949a01-cc81-40b1-bb93-6ec803ee415a', 'deleted': False}
2018-05-12 23:26:07 INFO (Thread-12) [gmusicapi.protocol.shared] could not locate client caller in stack:
File "/usr/lib/python3.5/threading.py", line 882, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 66, in _worker
work_item.run()
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 120, in turn_on
self._play()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 209, in _play
self._next_track()
File "/home/homeassistant/.homeassistant/custom_components/switch/gmusic.py", line 174, in _next_track
url = self._api.get_stream_url(track['trackId'])
File "<decorator-gen-102>", line 2, in get_stream_url
File "/srv/homeassistant/lib/python3.5/site-packages/gmusicapi/utils/utils.py", line 293, in wrapper
return function(*args, **kw)
File "/srv/homeassistant/lib/python3.5/site-packages/gmusicapi/clients/mobileclient.py", line 388, in get_stream_url
return self._make_call(mobileclient.GetStreamUrl, song_id, device_id, quality)
File "/srv/homeassistant/lib/python3.5/site-packages/gmusicapi/clients/shared.py", line 84, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/gmusicapi/protocol/shared.py", line 199, in perform
log.debug("%s(args=%s, kwargs=%s)",
File "/srv/homeassistant/lib/python3.5/site-packages/gmusicapi/utils/utils.py", line 107, in __getattr__
stack = traceback.extract_stack()
Thank you.
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.