Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run sonos2mqtt without speakers online #131

Open
3 tasks
svrooij opened this issue Jan 2, 2021 · 6 comments
Open
3 tasks

Run sonos2mqtt without speakers online #131

svrooij opened this issue Jan 2, 2021 · 6 comments

Comments

@svrooij
Copy link
Owner

svrooij commented Jan 2, 2021

Should investigate if it would be possible to run sonos2mqtt when there are no players online.
Think battery powered....

Currently this app is build to subscribe to group changes from one player and use that data to power the app.

Needed features:

  • monitor players going offline
  • keep running when there are no players
  • re-subscribe when a player comes back online

Prerequisites: At least a single player should be online when starting the app, else it won't know what to do. Or maybe a configuration that says I know there may not be any players, just continue.


Hello everybody,

I would like to reopen and expand this Issues.
Is there a way to start the Docker Container if there is currently no Sonos device in the network? The reason for this is that the Sonos devices are not always on power. The container always stops after two attempts.

Thanks :-)

Originally posted by @rliegmann in #123 (comment)

@BillSobel
Copy link

Can I suggest you cache your discovery from the previous run? Sonos equipment isn't likely to be added/removed so a cache would be perfect here.

@svrooij
Copy link
Owner Author

svrooij commented Jan 13, 2021

It's not just a matter of knowing the devices. This entire app is build based in the fact that it will receive events from the speakers.

Maybe it's better to just use the docker restart policy.

Also only a single speaker has to be online when you start sonos2mqtt. Then they can go offline (except the one sending the zone events).

@rliegmann
Copy link

Unfortunately I only have one SONOS speaker at the moment. 😢
At the moment, the Docker container keeps restarting in a loop. Maybe you could only loop the "start" metothe in the "index.ts" in interval. As soon as the speaker is back, it continues to run normally.

@svrooij
Copy link
Owner Author

svrooij commented Jan 13, 2021

Maybe a quick solution would be to make the discovery timeout configurable. Now it’s just static 10 seconds. What if we make that configurable and you set it to 180 seconds

@rliegmann
Copy link

Are the 10 seconds defined in the node-somos-ts or in the sonos2mqtt?
If the discovery time is increased, does the Docker container still restart?
Is there maybe the possibility to let the container run and to let the discovery run further?

@svrooij
Copy link
Owner Author

svrooij commented Jan 14, 2021

It’s defined here, https://github.com/svrooij/node-sonos-ts/blob/b6e73140375569d25839785c441f512aaa7c354d/src/sonos-manager.ts#L49

but it would be easy to make it configurable in sonos2mqtt

svrooij added a commit that referenced this issue Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants