Mute speaker while working?

Hi everyone.
I have searched some, but have not found an answer.

I am looking to mute a speaker that is in my office while working.
I have a nest mini right next to me, and I work from home.

Is there a way to mute that speaker from any notifications I may have setup with macros?
Ideally I would use the calendar integration to tell home assistant when I am working and the speaker would automagically get muted by that.

Thanks for the help.

Why mute it? Imho stopping the music would be a better solution, wouldn’t it?

That said, totally doable.
Do you have a calendar integration working already? Would start with that.

It’s not so much media I have playing, but notifications that I have that would automatically play.

I do have the google calendar integration working.

I think the assumption that it was music stems from the fact that muting notifications is counter productive. Why set the notifications in the first place?

Not exactly, you probably also have a phone that goes to ‘night mode’ or equivalent when you do not want to be disturbed by notifications.
It is quite a thing to go through automations and manually set each one of them to not trigger between X and Y … much easier to ‘mute’ the end-device. That said, not sure if one can control smart devices like nest/alexa directly to do this. From a HA perspective I guess one could set the volume to 0 but any automation changing that would take precedence, there is no ‘master’ switch that rules them all for as far as I can tell

Notifications like tts messages? Or notifications like Googles native broadcasts and reminders?

Broadcasts and reminders don’t use the media volume, so simply muting them wouldn’t work.

Yes, tts messages.

For example, I have automations that say if a door has been left open. (There are more of these coming, I just haven’t written them yet.)

I have made a speech engine like the one shown in slackerlabs video and I believe he got it from this github.
I can maybe set it up from there to do what I want?

Maybe I can’t do it that way.

But, plugging it into a smart outlet would definitely work.

Should be possible to make an automation to mute the media player entity as soon as there is an appointment.

Just try to mute it via developer tools and then send a tts.