Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Control Sonos Equalizer via Python script

$
0
0

@drimpart wrote:

I have a python script that changes the equalizer settings for one of my Sonos boxes, like Bass volume, Loudness and Treble - it uses the SoCo library, that so far as I know, also Home Assistant itself uses to control Sonos - but it’s somehow not working, I get this error in the Log:

ERROR (MainThread) [homeassistant.components.shell_command] Error running command: `python3 /config/python_scripts/kitchen_silent_mode_on.py`, return code: 1
NoneType: None

This is the Python Script, that works fine on my Mac (after pip install soco):

from soco import SoCo

sonos = SoCo("192.168.178.46")

sonos.bass = -5
sonos.treble = 10
sonos.loudness = False

and that is in my configuration.yaml:

shell_command:
kitchen_silent_mode_on: 'python3 /config/python_scripts/kitchen_silent_mode_on.py'

Does anybody know why it is not working?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>