/kalliope-snapcast-api

Neuron snapcast api for Kalliope

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Kalliope Snapcast API

Synopsis

Allow Kalliope to interact with Snapcast API.

This neuron doesn't coverage the whole API of snapcast. It only manage client volume and mute/unmute system so far. I'm happy to add more coverage if people need it or accept pull requests :).

I plan to add a second stream on snapcast at some point so i will update it some day^^.

Installation

kalliope install --git-url https://github.com/bacardi55/kalliope-snapcast-api.git

Options

(usage of a table generator is recommended)

parameter required default choices comments
action yes set_volume, mute, unmute The action choice
mac address yes * A list of mac address or * for all A list of mac address of snapcast client
volume no 55 Volume number Required only if action is set_volume
host yes 192.168.1.2 Volume number Required only if action is set_volume
port yes 1705 Volume number Required only if action is set_volume

Return Values

No return value

Synapses example

Description of what the synapse will do

  - name: "snapcast-set-volume-all"
    signals:
      - order: "Volume global de music à {{volume}}"
    neurons:
      - snapcastapi:
          action: 'volume'
          mac_addresses: '*'
          volume: '{{volume}}'
          host: '{{snapcast_host}}'
          port: '{{snapcast_port}}'

  - name: "snapcast-set-volume-client"
    signals:
      - order: "Set music volume at 55 in the kitchen"
    neurons:
      - snapcastapi:
          action: 'volume'
          mac_addresses:
              - '{{snapcast_brook}}'
          host: '{{snapcast_host}}'
          port: '{{snapcast_port}}'

  - name: "snapcast-mute-all"
    signals:
      - order: "Mute music everywhere"
    neurons:
      - snapcastapi:
          action: 'mute'
          mac_addresses: '*'
          host: '{{snapcast_host}}'
          port: '{{snapcast_port}}'

  - name: "snapcast-unmute-all"
    signals:
      - order: "Unmute music everywhere"
    neurons:
      - snapcastapi:
          action: 'unmute'
          mac_addresses: '*'
          host: '{{snapcast_host}}'
          port: '{{snapcast_port}}'

  - name: "snapcast-mute-client"
    signals:
      - order: "Mute the music in the kitchen"
    neurons:
      - snapcastapi:
          action: 'mute'
          mac_addresses: 
              - '{{snapcast_brook}}'
          host: '{{snapcast_host}}'
          port: '{{snapcast_port}}'

  - name: "snapcast-unmute-client"
    signals:
      - order: "unmute the music in the kitchen"
    neurons:
      - snapcastapi:
          action: 'unmute'
          mac_addresses:
              - '{{snapcast_brook}}'
          host: '{{snapcast_host}}'
          port: '{{snapcast_port}}'

Use private variable file.