Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Senior Member
    Join Date
    Feb 2006
    Posts
    120

    Play state to IFTTT (or similar)

    I like the idea of tracking play state. I have several pi core players using HiFi Berry Pro XLR. These are connected to powered monitors around my home. The Pi is powered over Ethernet, so always powered on.

    I'd like to use the play state of the Pi to trigger a remote controlled outlet to turn on the speakers. I already have the Amazon outlets that works with Alexa. So, an IFTTT action should be able to do this.

    Sadly, I am not a developer. I'll need some help.
    Michael Graves

    House: RPi3 + HifiBerry Pro XLR, M-Audio BX5As
    Home Office: RPi3 + HifiBerry Pro XLR, M-Audio BX5A D2, Berhringer B2092A subwoofer
    Workshop: RPi3 + HifiBerry Pro XLR, Alesis ProLinear 820s, JBL subwoofer
    Back Yard: SB3, Dayton Amp, Definitive Tech AW6500s
    Front Yard: SB3, SMSL Q5 Amp, Definitive Tech AW5500s
    SqueezeCenter on FreeNAS Mini with 10 TB

    email: mgraves <at> mstvp.com
    blog: http://www.mgraves.org

  2. #12
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,818
    Quote Originally Posted by mgraves View Post
    Sadly, I am not a developer. I'll need some help.
    Make some script like amp_power.sh with something that powers the wifi-plug.

    eg: (made for a Tasmota driven device without using mqtt "for this example" -in real life its using mqtt instead of curl)
    Code:
    #!/bin/bash
    port=9090
    server=lms.server.ip.address
    muzzigbox=ma:ca:dd:re:ss from the used player
    amp=IP.of.your.wifiswitch
    now=$(date +%H:%M)
    up=$(ps aux |grep squeezelite |grep -v grep|awk '{print $9}')
    if [ ! "$now" == "$up"  ]
       then
       sleep 2
       status=$(printf "$muzzigbox mode ?\nexit\n" | nc $server $port | cut -d ' ' -
       if [ $status = play ]
             then
             curl http://$amp/cm?cmnd=Power%20ON
       else
             curl http://$amp/cm?cmnd=Power%20OFF
       fi
    else
            echo detect startup
            printf "$muzzigbox power 0 \nexit\n"|nc $server $port
            curl http://$amp/cm?cmnd=Power%20OFF
    fi
    Use this script or similar for your -S option in squeezelite

    Take a look at this Thread

    The first script poweres the amp on / off if you press the powerbutton on the lms gui/ power the squeezelite player in any way.
    The 2.nd script that should run each xx minutes as a cronjob "unpowers the squeezeliteplayer if its not playing anymore" and that power cycle starts the poweroff for your Amp.

  3. #13
    Senior Member
    Join Date
    Feb 2006
    Posts
    120
    Quote Originally Posted by DJanGo View Post
    Take a look at this Thread

    The first script poweres the amp on / off if you press the powerbutton on the lms gui/ power the squeezelite player in any way.
    The 2.nd script that should run each xx minutes as a cronjob "unpowers the squeezeliteplayer if its not playing anymore" and that power cycle starts the poweroff for your Amp.
    Thanks for the info!

    I'm not concerned about powering off the plugin. That can be set up occur automatically on a scheduled basis. That is, turn it off every night at 11pm.
    Michael Graves

    House: RPi3 + HifiBerry Pro XLR, M-Audio BX5As
    Home Office: RPi3 + HifiBerry Pro XLR, M-Audio BX5A D2, Berhringer B2092A subwoofer
    Workshop: RPi3 + HifiBerry Pro XLR, Alesis ProLinear 820s, JBL subwoofer
    Back Yard: SB3, Dayton Amp, Definitive Tech AW6500s
    Front Yard: SB3, SMSL Q5 Amp, Definitive Tech AW5500s
    SqueezeCenter on FreeNAS Mini with 10 TB

    email: mgraves <at> mstvp.com
    blog: http://www.mgraves.org

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •