Skip to main content

A Sonos plugin for automate-home

Project description

automate-sonos-plugin

Build Status codecov Documentation Status

The Sonos plugin for the automate-home project.

Yaml examples of usage

Trigger and command for a sound player model.

- !Performer
  name: "forced on/off triggers"
  for appliance: "a sound player"
  commands: []
  triggers:
  - !soco_plugin.trigger.play.Trigger
      addresses: ["Bagno"]
      events:
        - !home.appliance.sound.player.event.forced.Event.On
  - !soco_plugin.trigger.stop.Trigger
      addresses: ["Bagno"]
      events:
        - !home.appliance.sound.player.event.forced.Event.Off
  - !soco_plugin.trigger.pause.Trigger
      addresses: ["Bagno"]
      events:
        - !home.appliance.sound.player.event.forced.Event.Off
  - !soco_plugin.trigger.volume.Trigger {addresses: ["Bagno"]}

- !Performer
  name: "sonos commands"
  for appliance: "a sound player"
  commands:
  - !soco_plugin.command.pause.Command {addresses: ["Bagno"]}
  - !soco_plugin.command.playlist.Command {addresses: ["Bagno"]}
  - !soco_plugin.command.volume.absolute.Command {addresses: ["Bagno"]}
  - !soco_plugin.command.mode.Command { addresses: [ "Bagno" ], fields: { "mode": "SHUFFLE" } }
  - !soco_plugin.command.play.Command {addresses: ["Bagno"]}
  triggers: []

- !Performer
  name: "fade in or out command"
  for appliance: "a sound player"
  commands:
    - !soco_plugin.command.volume.ramp.Command { addresses: [ "Bagno" ], fields: { "ramp_type": 'SLEEP_TIMER_RAMP_TYPE' } }
  triggers: [ ]

- !Performer
  name: "sonos relative volume up through knx dimming button"
  for appliance: "a sound player"
  triggers:
  - !knx_plugin.trigger.dpt_control_dimming.step.up.Trigger {addresses: [0x0C09]}
  commands:
    - !soco_plugin.command.volume.relative.Command {addresses: ["Bagno"], fields: {"delta": 10}}

- !Performer
  name: "sonos relative volume down through knx dimming button"
  for appliance: "a sound player"
  triggers:
  - !knx_plugin.trigger.dpt_control_dimming.step.down.Trigger {addresses: [0x0C09]}
  commands:
    - !soco_plugin.command.volume.relative.Command {addresses: ["Bagno"], fields: {"delta": -10}}

- !Performer
  name: "alarm switch on/off player when armed/unarmed alarm system"
  for appliance: "a sound player"
  commands:
    - !soco_plugin.command.play.Command {addresses: ["Bagno"]}
    - !soco_plugin.command.pause.Command {addresses: ["Bagno"]}
  triggers:
    - !knx_plugin.trigger.dpt_switch.On
      addresses: [ 0xA1C, ]
      events:
        - !home.event.presence.Event.Off
    - !knx_plugin.trigger.dpt_switch.Off
      addresses: [ 0xA1C, ]
      events:
        - !home.event.presence.Event.On

- !Performer
  name: "force circadian rhythm through knx scene button"
  for appliance: "a sound player"
  commands:
    - !soco_plugin.command.playlist.Command {addresses: ["Bagno"]}
    - !soco_plugin.command.volume.absolute.Command {addresses: ["Bagno"]}
    - !soco_plugin.command.play.Command {addresses: ["Bagno"]}
  triggers:
    - !knx_plugin.trigger.dpt_scene_control.Activate
      addresses: [ 0x0B0F ]
      number: 15
      events:
        - !home.appliance.sound.player.event.forced.Event.CircadianRhythm

- !Performer
  name: "unforce circadian rhythm through another knx scene button"
  for appliance: "a sound player"
  commands:
    - !soco_plugin.command.pause.Command {addresses: ["Bagno"]}
  triggers:
    - !knx_plugin.trigger.dpt_scene_control.Activate
      addresses: [ 0x0B10 ]
      number: 16
      events:
        - !home.appliance.sound.player.event.forced.Event.Not

- !Performer
  name: "force on/off through knx start/stop button"
  for appliance: "a sound player"
  commands:
    - !soco_plugin.command.pause.Command {addresses: ["Bagno"]}
    - !soco_plugin.command.playlist.Command {addresses: ["Bagno"]}
    - !soco_plugin.command.volume.absolute.Command {addresses: ["Bagno"]}
    - !soco_plugin.command.play.Command {addresses: ["Bagno"]}
  triggers:
    - !knx_plugin.trigger.dpt_start.Start
      addresses: [ 0x0C09, ]
      events:
        - !home.appliance.sound.player.event.forced.Event.On
    - !knx_plugin.trigger.dpt_start.Stop
      addresses: [ 0x0C09, ]
      events:
        - !home.appliance.sound.player.event.forced.Event.Not

Documentation

Contributing

Pull requests are welcome!

License

The automate-sonos-plugin is licensed under MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

automate-sonos-plugin-0.9.1.tar.gz (10.2 kB view hashes)

Uploaded Source

Built Distribution

automate_sonos_plugin-0.9.1-py3-none-any.whl (17.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page