Access to Max2play away from home

Max2Play Home 2016 (en) Forums Max2Play on Raspberry PI Access to Max2play away from home

This topic contains 4 replies, has 2 voices, and was last updated by  Martinsthlm premium 5 days, 22 hours ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • 4. Januar 2019 at 18:09 #43162

    Hi,
    I use Spotify to randomly play some music when nobody is home (to give the impression that someone is home). Works fine most of the time. However, sometimes the spotify connect plugin on LMS and the Spotify plugin does not work and I need to reboot Max2play. Is there a way to do it remotely when I am not on my home network? In other words, I want to remote access. One way to solve it could be to install a remote switch to turn off the power to the RPi but I guess it is not a good solution for the SD card etc.
    /Martin

    7. Januar 2019 at 15:00 #43205

    Hi Martin,

    You can use our API examples plugin to copy the HTTP command for Max2Play reboot. You can use this command through any device in your network or an existing home automation setup or even in your own VPN solution to access it from anywhere.

    9. Januar 2019 at 11:54 #43322

    Thanks Heiner!
    I made a script in Home Asssistant and it works perfectly.

    10. Januar 2019 at 10:38 #43378

    That sounds great! If you can find the time, we would appreciate you sharing your process and script (anonymized/generalized if possible) for other users to be able to recreate it.

    11. Januar 2019 at 18:38 #43536

    No probblem. It was not that advanced and quite easy.
    In the config.yaml in Home assistant I wrote:

    rest_command:
    my_request:
    url: http://192.168.1.xx/plugins/max2play_settings/controller/Squeezeserver.php?action=restart
    method: GET
    my_request_2:
    url: http://192.168.1.xx:9000/status.html?p0=mixer&p1=volume&p2=-10&player=%5BMAC ADRESS FROM M2P API]
    method: GET
    my_request_3:
    url: http://192.168.1.xx:9000/status.html?p0=mixer&p1=volume&p2=%2B10&player=%5BMAC ADRESS FROM M2P API]
    method: GET

    Important, I gave the RPI a static ip adress in the router since I point the rest_commandt to a specific local IP adress.
    Then I used the script editor in Hassio and created scripts „rest_command.my_request“ without any additional adjustments, „rest_command.my_request_2“ etc and then added the script ID to the Lovelace UI.

    Voilá, from the Home assistant app I can execute each specific script and the squeezebox server restarts, lower volume etc.

    Now I just have to wait until Spotify connect is unreachable (not very often that problem occurs though) to see if it solves the problem. It should. 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Register here