ppanagiotis / pymusiccast

Group MusicCast Speakers with Home Assistant
MIT License
37 stars 8 forks source link
automation hass hassio home-assistant homeassistant lovelace media-player musiccast yamaha

Deprecated after Home Assistant 2021.7. Use official integration

# # #

Group MusicCast Speakers with Home Assistant

After waiting a year for pymusiccast to support speakers group I decide to create a custom module, overwriting existing pymusiccast module, using code from this PR (credits @hcoohb).

musiccast group management example

Install

HACS

Manual

Setup

- platform: musiccast_yamaha
  host: `your.speaker.ip.address`
  port: 5009

source ignore / source names attributes (optional)

- platform: musiccast_yamaha
  host: `your.speaker.ip.address`
  port: 5009
  source_ignore:
    - "AUX"
    - "HDMI6"
  source_names:
    HDMI1: "ChromeCast"
    AV4: "Vinyl"

Using grouping at home assistant as a service

To add a speaker at a group:

action:
  - service: musiccast_yamaha.join
    data:
      entity_id: `THE_CLIENT_SPEAKER`
      master: `THE_MASTER_SPEAKER`

To remove a spearker from group

action:
  - service: musiccast_yamaha.unjoin
    entity_id: `THE_CLIENT_SPEAKER`

Using grouping at home assistant with custom:mini-media-player

To add the group layout at custom:mini-media-player you have to add something like this at your ui-lovelace.yaml:


views:
  - title: Home Assistant
    id: media_player
    icon: mdi:audio-video
    cards:
      - type: entities
        entities:
          - type: custom:mini-media-player
            group: true
            entity: media_player.livingroom
            name: LivingRoom
            toggle_power: false
            artwork: cover
            hide:
              icon: true
              power_state: false
            speaker_group:
              platform: musiccast_yamaha
              expanded: false
              entities:
                - entity_id: media_player.livingroom
                  name: LivingRoom
                - entity_id: media_player.office
                  name: Office
                - entity_id: media_player.bedroom
                  name: BedRoom
                - entity_id: media_player.yard
                  name: Yard
          - type: custom:mini-media-player
            group: true
            name: Office
            hide:
              icon: true
              controls: true
              progress: true
              source: true
              info: true
              power_state: false
            entity: media_player.office
            toggle_power: false
          - type: custom:mini-media-player
            group: true
            name: BedRoom
            hide:
              icon: true
              controls: true
              progress: true
              source: true
              info: true
              power_state: false
            entity: media_player.bedroom
            toggle_power: false
          - type: custom:mini-media-player
            group: true
            name: Yard
            hide:
              icon: true
              controls: true
              progress: true
              source: true
              info: true
              power_state: false
              volume: true
            entity: media_player.yard
            toggle_power: false

You like this project? Be nice!

Buy me a coffee beer! ;-)

Buy me a ~~coffee~~ beer!

License

This project is under the MIT license.