Git Product home page Git Product logo

hass-integrations's People

Contributors

burningstone91 avatar bushvin avatar daniele-athome avatar guix77 avatar koying avatar paolapersico1 avatar schmacka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hass-integrations's Issues

Log Errors in HA 2024.5

Since HA 2024.5.1 my Log is filled with errors.
Player seems to work without problems.

2024-05-05 11:54:10.578 ERROR (WSListener) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/srv/ha_py312/lib/python3.12/site-packages/mopidyapi/wsclient.py", line 63, in _websocket_runner
    loop.run_until_complete(packethandler())
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 685, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/srv/ha_py312/lib/python3.12/site-packages/mopidyapi/wsclient.py", line 54, in packethandler
    self._on_message(msg)
  File "/srv/ha_py312/lib/python3.12/site-packages/mopidyapi/wsclient.py", line 69, in _on_message
    self._route_event(msg)
  File "/srv/ha_py312/lib/python3.12/site-packages/mopidyapi/wsclient.py", line 93, in _route_event
    cb(neatdata)
  File "/home/homeassi/.homeassistant/custom_components/mopidy/speaker.py", line 1040, in __ws_stream_title_changed
    self.entity.force_update_ha_state()
  File "/home/homeassi/.homeassistant/custom_components/mopidy/media_player.py", line 238, in force_update_ha_state
    self.async_schedule_update_ha_state(force_refresh=True)
  File "/srv/ha_py312/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1252, in async_schedule_update_ha_state
    self.hass.async_create_task(
  File "/srv/ha_py312/lib/python3.12/site-packages/homeassistant/core.py", line 816, in async_create_task
    self.verify_event_loop_thread("async_create_task")
  File "/srv/ha_py312/lib/python3.12/site-packages/homeassistant/core.py", line 440, in verify_event_loop_thread
    frame.report(
  File "/srv/ha_py312/lib/python3.12/site-packages/homeassistant/helpers/frame.py", line 162, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/srv/ha_py312/lib/python3.12/site-packages/homeassistant/helpers/frame.py", line 203, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that custom integration 'mopidy' calls async_create_task from a thread at custom_components/mopidy/media_player.py, line 238: self.async_schedule_update_ha_state(force_refresh=True). Please report it to the author of the 'mopidy' custom integration.
2024-05-05 11:54:14.129 WARNING (SyncWorker_15) [custom_components.mopidy.speaker] The websocket connection was interrupted, re-create connection

playlist-attribute doesn't show up sometimes when a playlist is playing

On rare occasions it shows up but usually it doesn't. I only use a single m3u8-playlist with over 500 local tracks, it takes quite some time to load (10+ seconds) whenever chosen (just in case that matters). Here are some example lines from the mentioned playlist:

local:track:Haute%20-%20Shut%20Me%20Down%20%5BVanucci%5D.opus
local:track:Brijs%20-%20Shy%20%5BOriginal%5D.flac
local:track:Hook%20N%20Sling%20-%20Silver%20Service%20%5BOriginal%5D.mp3

Homeassistant CORE

Hi,
Is there any instructions to install mopidy media player in homeassistant CORE setup. I want to play local mp3 files from pi
through 3.5mm audio jack as notifications. Thanks

service calls are skipped when called in quick succession

Hey hey,
I noticed an issue whenever services are called in quick succession, sometimes (not always) only the first command gets executed. For example, I have a ha-script that sets consume_mode shuffle & repeat in this order but the only thing that gets applied is the consume-mode.

Home Assistant 2022.2.5 + HACS-mopidy 1.4.3

Upon startup receiving error:

2022-02-11 15:46:53 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/discovery_flow.py", line 74, in _async_process_pending_flows
    await gather_with_concurrency(
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 185, in gather_with_concurrency
    return await gather(
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 183, in sem_task
    return await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 230, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/mopidy/config_flow.py", line 136, in async_step_zeroconf
    getattr(discovery_info, CONF_NAME)[: len(getattr(discovery_info, CONF_TYPE) +1) * -1]
TypeError: can only concatenate str (not "int") to str

Using the UI integration if that matters...

A clarification

Hi,

One thing that I would like to understand. Is your integration meant to control mopidy servers using HomeAssistant, right? For example, I have mopidy installed in my notebook and if I add to the integration its IP and hostname, i would be able to control from any device I can access HA. This is not meant for example to Mopidy being able to be played in Alexa or Chromecast?

Thanks

Play/Stop music in automation

Hello,

I want to only play music in my automation (I have selected music file before). In my automation I choose "Add action -> call service" and I have only "mopidy.restore", "mopidy.search", "mopidy.snapshot". I don't see mopidy.play, mopidy.pause (for stop plaing).

Please help.

Unexpected exception importing platform (HA 2024.1.3)

  • Core 2024.1.3
  • Supervisor 2023.12.0
  • Operating System 11.4
  • Frontend 20240104.0

Logger: homeassistant.loader
Source: loader.py:842
First occurred: 20:53:29 (1 occurrences)
Last logged: 20:53:29

Unexpected exception importing platform custom_components.mopidy.media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/mopidy/media_player.py", line 162, in <module>
    class MopidyMediaPlayerEntity(MediaPlayerEntity):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 408, in __init__
    wrap_attr(cls, property_name)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 380, in wrap_attr
    raise TypeError(f"Can't override {attr_name} in subclass")
TypeError: Can't override _attr_state in subclass

Include attributes for consume-mode & media_type (if possible)

Hey, it is me again :) still messing around with your integration to see what I can do.

Today I wanted to make Lovelace react to the media_type that is playing (local:track:, youtube:video:, http:, ect.) I know it is part of media_content_id but it turned out to be a pain in the b*tt to just do a simple trim on a string within lovelace to get a proper value, so it would be very handy for those 2 people on earth who would want that without the clutter.

Having feedback in Home Assistant for the state of the consume_mode would be nice as well :)

Config Home Assistant Integration doesn't work

When i install this from HACS, the next step doesn't appear (Home assistant integration) and manual configuration doesn't work.

GUI
Go to the Integrations page and click + ADD INTEGRATION
Select Mopidy in the list of integrations
Fill out the requested information. Make sure to enter your correct FQDN or IP address. Using localhost, 127.0.0.1, ::1 or any other loopback address will disable Mopidy-Local artwork.
Click Submit.
Repeat the above steps to add more Mopidy Server instances.

Manual Configuration
add a media player to your home assistant configuration (<config dir>/configuration.yaml):
media_player:
- name: <mopidy identifier>
  host: <FQDN or IP address>
  port: <port if different from 6680>
  platform: mopidy
Restart your Home assistant to make changes take effect.

Mopidy restore on youtube doesn't work

Hello,

First of all, thank you very much for your time. It's a great project, already a part of my daily routine.
I'm using the Mopidy-Youtube. I have noticed that the snapshot / restore service doesn't work.
After the restore the song goes back to the start and not at the saved position.

tts homeassistant - queuelist

I use tts service from home assistant like that :

/config/automations.yaml

  • alias: The rabbit wants to talk (fr-fr)
    trigger:
    platform: mqtt
    topic: nabaztag/sensor/box-nabaztag/talk-fr
    action:
    service: tts.cloud_say
    entity_id: media_player.mopidy
    data:
    message: '{{ trigger.payload }}'
    language: fr-CH
    options:
    gender: female

basically I do a mqtt request with text and homeassistant turn that into sound and stream it to my mopidy server
file is like that : http://192.168.1.141:8123/api/tts_proxy/c22318c911181a4b7285fe9811235cd18ab366f6_fr-ch_58612170f0_cloud.audiooutput.mp3

it's great for most cases. But I'm trying to converse with chat gpt and in order to increase the delay of treatment I would like to split the response into multiple sentences and do an mqtt query for each sentence. In this way during the reading of the first sentence, the 2nd is being processed etc. I can save a few seconds this way.

If I try to do that with the mopidy integration it doesn't work, indeed as soon as the sound is ready it is played, and if the previous sound is not finished it stops it to replace it.

I would like some sort of queuelist option. I don't feel like it's feasible.

Errors on HA startup in beta 2021.4x

On HA 2021.4.x beta seeing multiple errors on startup.
The Integration works without issues, just for info.

2021-04-04 10:57:26 ERROR (SyncWorker_1) [mopidyapi.client] Could not decode json from Mopidy: Expecting value: line 1 column 1 (char 0)
--- Logging error ---
Traceback (most recent call last):
  File "/srv/ha/lib/python3.8/site-packages/mopidyapi/client.py", line 77, in rpc_call
    r = post(self.http_url,
  File "/srv/ha/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/homeassi/.homeassistant/custom_components/mopidy/config_flow.py", line 102, in async_step_zeroconf
    await self.hass.async_add_executor_job(
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassi/.homeassistant/custom_components/mopidy/config_flow.py", line 24, in _validate_input
    client.rpc_call("core.get_version")
  File "/srv/ha/lib/python3.8/site-packages/mopidyapi/client.py", line 100, in rpc_call
    raise ConnectionError(ex)
requests.exceptions.ConnectionError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/handlers.py", line 1401, in emit
    self.enqueue(self.prepare(record))
  File "/usr/lib/python3.8/logging/handlers.py", line 1384, in prepare
    msg = self.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 925, in format
    return fmt.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 664, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.8/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/srv/ha/bin/hass", line 8, in <module>
    sys.exit(main())
  File "/srv/ha/lib/python3.8/site-packages/homeassistant/__main__.py", line 313, in main
    exit_code = runner.run(runtime_conf)
  File "/srv/ha/lib/python3.8/site-packages/homeassistant/runner.py", line 113, in run
    return asyncio.run(setup_and_run_hass(runtime_config))
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/homeassi/.homeassistant/custom_components/mopidy/config_flow.py", line 106, in async_step_zeroconf
    _LOGGER.warning("Not a mopidy server", error)
  File "/usr/lib/python3.8/logging/__init__.py", line 1454, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1585, in _log
    self.handle(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 1595, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 1657, in callHandlers
    hdlr.handle(record)
  File "/srv/ha/lib/python3.8/site-packages/homeassistant/util/logging.py", line 50, in handle
    self.emit(record)
Message: 'Not a mopidy server'
Arguments: (ConnectionError(JSONDecodeError('Expecting value: line 1 column 1 (char 0)')),)

Error in HA logs - No image_url found

Hi,
from long time I'm seeing this error in my HA instance - its just warning so everything seems to function but i'm curiuos how to fix it or maybe ist some kind of bug?
the number of events increases every moment

Ten błąd pochodzi z niestandardowej integracji.

Logger: custom_components.mopidy.speaker
Source: custom_components/mopidy/speaker.py:192
Integration: Mopidy (documentation, issues)
First occurred: 00:36:38 **(4709 occurrences)**
Last logged: 13:16:23

No image_url found for https://stream.rcs.revma.com/ye5kghkgcm0uv

Basically i'm using mopidy (iris frontned) with snapcast server and client using to stream internet radio using official links below:

https://stream.radio357.pl/
http://live.r357.eu/

Mopidy 3.4.1
Mopidy component 2.2.1

HA OS:
Core: 2023.12.1
Supervisor: 2023.11.6
Operating System: 11.2
Interfejs użytkownika: 20231208.2

Mopidy freezed after choose TTS or Radio in Home Assistant

Hi,

i would like to ask you.
I have Odroid device with Home Assistant (newest version) and connected speaker over 3,5mm jack.
I’ve installed Mopidy and it’s working fine, but…

it’s not possible to udpate it (it’s not main problem)
If i choose TTS or Radio from Media, Mopidy freezed…
I’ve created short video to describe my problem

https://youtu.be/NipPb9csjQA

Can you help me please?
And i would like to install spotify extension but i dont know how i can do it 😦 in Home Assistant

Thank you so much

Connection issues

I'm using latest HA inside VM on Proxmox and I saw many mopidy integration errors in HA logs:

Mopidy connection error: HTTPConnectionPool(host='mopidy.local', port=6680): Max retries exceeded with url: /mopidy/rpc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7084b16200>: Failed to establish a new connection: [Errno 22] Invalid argument'))

After some testing: mopidy server is working fine, HA is working fine - I am able to use the dashboard at any time (no connection issues).

How does search work?

I noticed you have implemented the search API for this integration. Just wondering if you have any tips on implementing this in HA. I currently use the mini media player and it's working great, but I want to be able to search and play songs from the results.

Is there a component to make this work with a GUI?

Warnings in 2021.12 beta

HA Startup log:

2021-12-08 08:46:42 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that accessed discovery_info['hostname'] instead of discovery_info.hostname; this will fail in version 2022.6. Please report issue to the custom component author for mopidy using this method at custom_components/mopidy/config_flow.py, line 110: mdns_address = discovery_info["hostname"][:-1]

There is no rush, time until June 2022. 😄

Issues with true/false values within attributes

Some attributes return on/off and some return true/false.
image
The true/false values cause issues when I use conditions in scripts, because these states aren't recognized by HA if i put them in quotation-marks. I can work around that by removing them manually but this disables the ui-editor.
image
I guess HA doesn't like booleans in attribute-values and persists on having strings (on/off).

[Feature request] Consume-switch

Having the ability to enable/disable "consume" would be very beneficial (for me). Do you think you could add that as a switch or something? Great integration btw, I make great use of it every day :)

Error log after update to 2.3.0

Hi, after update to 2.3.0 I'm getting error in log:

Did reinstall and restar Home Assistant

Anyone seeing same behavior?

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:894
First occurred: 12:34:45 (75 occurrences)
Last logged: 12:47:05

Update for media_player.radio fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 894, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1214, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mopidy/media_player.py", line 607, in update
    self.speaker.update()
  File "/config/custom_components/mopidy/speaker.py", line 973, in update
    self.queue.update()
  File "/config/custom_components/mopidy/speaker.py", line 311, in update
    self.update_current_track()
  File "/config/custom_components/mopidy/speaker.py", line 330, in update_current_track
    self.update_current_image_url()
  File "/config/custom_components/mopidy/speaker.py", line 343, in update_current_image_url
    self._current_track_image_url = self.__get_track_image(uri)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mopidy/speaker.py", line 191, in __get_track_image
    elif (self.queue[tlid].get("is_stream")):
                     ^^^^
NameError: name 'tlid' is not defined

Manual configuration doesn't work

I suppose it's due to HA moving to GUI first paradigm the manual configuration described in the README.md doesn't add mopidy.* services.

Manual Configuration

    add a media player to your home assistant configuration (<config dir>/configuration.yaml):

media_player:
- name: <mopidy identifier>
  host: <FQDN or IP address>
  port: <port if different from 6680>
  platform: mopidy

media_player.mopidy does being created but no services mopidy.* are becoming available. When I add the integration via GUI they does appear.

Setup.py Error | Platform not found

I follwed the instructions but when I added the Mopidy Server I got this error in my notifications.

Unable to prepare setup for platform mopidy.media_player: Platform not found (cannot import name 'async_process_play_media_url' from 'homeassistant.components.media_player' (/usr/src/homeassistant/homeassistant/components/media_player/__init__.py)).

mopidy mediaplayer not working

log entry:

Logger: homeassistant.setup
Source: setup.py:403
First occurred: 11:04:55 (1 occurrences)
Last logged: 11:04:55

Unable to prepare setup for platform 'mopidy.media_player': Platform not found (Exception importing custom_components.mopidy.media_player).

Home Assistant

Core 2024.1.3
Supervisor 2023.12.1
Operating System 11.4
Frontend 20240104.0

Logger:

Logger: homeassistant.loader
Source: loader.py:842
First occurred: 11:04:55 (1 occurrences)
Last logged: 11:04:55

Unexpected exception importing platform custom_components.mopidy.media_player
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/mopidy/media_player.py", line 161, in
class MopidyMediaPlayerEntity(MediaPlayerEntity):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 408, in init
wrap_attr(cls, property_name)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 380, in wrap_attr
raise TypeError(f"Can't override {attr_name} in subclass")
TypeError: Can't override _attr_supported_features in subclass

'MopidySpeaker' object has no attribute 'media'

Hello, thanks for putting together this project, it is getting me much closer to my goal of running a multi-room audio system. I just came across this project yesterday and installed the latest and greatest, v.2.2.0.

The problem I'm having is when I call the mopidy.snapshot service, it fails with the following error:

'MopidySpeaker' object has no attribute 'media'

The related configuration in my automation is:

service: mopidy.snapshot
data: {}
target:
  entity_id: media_player.mopidy

And the traceback from home-assistant.log:

2023-11-12 13:48:20.364 ERROR (MainThread) [homeassistant.components.automation.test_music_tts_snapshot] While executing automation automation.test_music_tts_snapshot
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 655, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 830, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mopidy/media_player.py", line 311, in service_snapshot
self.speaker.take_snapshot()
File "/config/custom_components/mopidy/speaker.py", line 933, in take_snapshot
"mediaposition": self.media.position,
^^^^^^^^^^
AttributeError: 'MopidySpeaker' object has no attribute 'media'

Integration not working after upgrade to 2023.8.0

After upgrade to 2023.8.0 integration not working anymore.
After delete and create new mopidy entity it creating empty item without any entities
Also there is nothing interesting in log.
Existing entities added before just unavailable.

Load Tidal playlists doesn't work

Hello

First of I don't know if the issue is about this integration or the mopidy-tidal extension(*).

I discovered this with your integration so in order to track my notes i start here.

Expected Situation

I choose a Tidal playlist and play it on mopidy

Actual situation

Mopidy load the right amount of tracks, but with id 0:0:0 and nothing happen.

Workaround

I created a pyscript shared on home assistant forums as workaround.

It acts as 3 steps :

  1. core.playlists.get_items
  2. core.tracklist.add
  3. core.playback.play

I guest you would like more informations.
Here are mopidy logs:

May 22 16:45:39 debian mopidy[509]: DEBUG    [MpdFrontend-9] mopidy.listener Sending playlist to MpdSession: {}
May 22 16:45:39 debian mopidy[509]: DEBUG    [HttpServer] mopidy.http.handlers Received RPC message from 10.0.1.17: b'{"jsonrpc": "2.0", "id": 0, "method": "core.tracklist.add", "params": {"uris": ["tidal:playlist:2e151dcc-fa86-405a-9b56-4f4399035c29"]}}'
May 22 16:45:39 debian mopidy[509]: INFO     [TidalBackend-2] mopidy_tidal.library Lookup uris 'tidal:playlist:2e151dcc-fa86-405a-9b56-4f4399035c29'
May 22 16:45:39 debian mopidy[509]: DEBUG    [TidalBackend-2] mopidy_tidal.lru_cache Filesystem cache hit for tidal:playlist:2e151dcc-fa86-405a-9b56-4f4399035c29
May 22 16:45:39 debian mopidy[509]: INFO     [TidalBackend-2] mopidy_tidal.library Returning 25 tracks
May 22 16:45:39 debian mopidy[509]: DEBUG    [Core-6] mopidy.core.tracklist Triggering event: tracklist_changed()
May 22 16:45:39 debian mopidy[509]: DEBUG    [Core-6] mopidy.listener Sending tracklist_changed to CoreListener: {}
May 22 16:45:39 debian mopidy[509]: DEBUG    [MpdFrontend-9] mopidy.listener Sending playlist to MpdSession: {}
May 22 16:45:39 debian mopidy[509]: DEBUG    [HttpServer] mopidy.http.handlers Received RPC message from 10.0.1.17: b'{"jsonrpc": "2.0", "id": 0, "method": "core.playback.play"}'
May 22 16:45:40 debian mopidy[509]: DEBUG    [Audio-1] mopidy.audio.gst Changing state to GST_STATE_READY: result=GST_STATE_CHANGE_SUCCESS
May 22 16:45:40 debian mopidy[509]: INFO     [TidalBackend-2] mopidy_tidal.playback TIDAL uri: tidal:track:0:0:0
May 22 16:45:40 debian mopidy[509]: DEBUG    [MainThread] mopidy.audio.gst Got STATE_CHANGED bus message: old=GST_STATE_NULL new=GST_STATE_READY pending=GST_STATE_VOID_PENDING
May 22 16:45:40 debian mopidy[509]: WARNING  [TidalBackend-2] tidalapi.request HTTP error on 404
May 22 16:45:40 debian mopidy[509]: ERROR    [Core-6] mopidy.core.playback TidalBackend backend caused an exception.

As you can see it get tidal:playlist:2e151dcc-fa86-405a-9b56-4f4399035c29 (nirvana essentials)
It found 25 tracks.
They're added but with the following uri : "tidal:track:0:0:0"

Note

* : I tried with an other mopidy client(M.AL.P on android), and i can load a playlist without issue. So i doubt mopidy-tidal is in cause.

edit: add note

TTS Play

Hi,
Since the last update I am getting this error:

Nov 02 09:29:10 xeon.lan hass[71464]: NameError: name 'uri' is not defined
Nov 02 09:29:10 xeon.lan hass[71464]: 2023-11-02 09:29:10.397 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139691233432896] Error handling message: Unknown error (unknown_error) marcel from 192.168.55.1 (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36)
Nov 02 09:29:10 xeon.lan hass[71464]: Traceback (most recent call last):
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
Nov 02 09:29:10 xeon.lan hass[71464]: await func(hass, connection, msg)
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 731, in handle_execute_script
Nov 02 09:29:10 xeon.lan hass[71464]: script_result = await script_obj.async_run(msg.get("variables"), context=context)
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
Nov 02 09:29:10 xeon.lan hass[71464]: return await asyncio.shield(run.async_run())
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
Nov 02 09:29:10 xeon.lan hass[71464]: await self._async_step(log_exceptions=False)
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
Nov 02 09:29:10 xeon.lan hass[71464]: self._handle_exception(
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
Nov 02 09:29:10 xeon.lan hass[71464]: raise exception
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
Nov 02 09:29:10 xeon.lan hass[71464]: await getattr(self, handler)()
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
Nov 02 09:29:10 xeon.lan hass[71464]: response_data = await self._async_run_long_action(
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
Nov 02 09:29:10 xeon.lan hass[71464]: return long_task.result()
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
Nov 02 09:29:10 xeon.lan hass[71464]: response_data = await coro
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
Nov 02 09:29:10 xeon.lan hass[71464]: return await target(service_call)
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/components/tts/legacy.py", line 147, in async_say_handle
Nov 02 09:29:10 xeon.lan hass[71464]: await hass.services.async_call(
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
Nov 02 09:29:10 xeon.lan hass[71464]: response_data = await coro
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
Nov 02 09:29:10 xeon.lan hass[71464]: return await target(service_call)
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
Nov 02 09:29:10 xeon.lan hass[71464]: return await service.entity_service_call(
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
Nov 02 09:29:10 xeon.lan hass[71464]: response_data = await _handle_entity_call(
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
Nov 02 09:29:10 xeon.lan hass[71464]: result = await task
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^^^^^^^^
Nov 02 09:29:10 xeon.lan hass[71464]: File "/config/custom_components/mopidy/media_player.py", line 312, in async_play_media
Nov 02 09:29:10 xeon.lan hass[71464]: uri.startswith("https://www.youtube.com/")
Nov 02 09:29:10 xeon.lan hass[71464]: ^^^
Nov 02 09:29:10 xeon.lan hass[71464]: NameError: name 'uri' is not defined

Platform mopidy does not generate unique IDs. ID 192_168_0_15_6680 already exists

Hi,
I'm running HA core 2024.5.0 in a docker container on host 192.168.0.15. I have mopidy setup to connect to the host computer that runs the HA container on a specific IP address (192.168.0.15) . The host computer is using Pulseaudio and is playing music directly fine (outside of mopidy).

I added the following lines to the HA configuration.yaml file:

media_player:
- name: media_mopidy
  host: 192.168.0.15
  #port: 6680
  platform: mopidy

In HA log is the following error:
2024-05-27 09:23:08.213 ERROR (MainThread) [homeassistant.components.media_player] Platform mopidy does not generate unique IDs. ID 192_168_0_15_6680 already exists - ignoring media_player.mopidy_server

I'm probably doing something stupid. What am I doing wrong?

Progress Bar

I have noticed that if I play a song from a playlist directly in Mopidy (webclient) the HA media player shows the progress bar, however if I do the same thing via search in the webclient, there is no progress bar in HA.

Not sure if this is a bug?

Really great job on this integration by the way!

Not working with HA 2024.1.0

This integration does not seem to work after updating. There is no real error message in the logs, but all three mopidy entities are unavailable. The only mention of mopidy in the logs is No image_url found for https://…, but this is only a warning.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.