Stop Music when Zoom Meeting is On
--
I created this simple integration to stop any music playing on Google Home device if the Zoom meeting is on.
MQTT in Home Assistant
Enable and start the MQTT Mosquito Broker. Please refer to my tutorial here on how to configure it.
Go to File Editor and search for config/configuration.yaml, insert the following lines to create a binary sensor:
binary_sensor:
— platform: mqtt
name: zoom
state_topic: “home/livingroom/zoom”
payload_on: “ON”
payload_off: “OFF”
And then restart the Home Assistant to take effect.
Go to the Configuration >Entities and search for binary_sensor.zoom. If you can find it, the setting is correct.
Create a custom dashboard from Configuration > Lovelace Dashboards and Add Dasboard.
Click Add Card on the new dashboard that you have created.
And search for the entities.
Insert binary_sensor.zoom in the entity and save it.
Python MQTT Client
I wrote an MQTT client in Python to check the Zoom status based on the sub process.
And send the status to MQTT broker on Home Assistant.
Save the Python code as zoom.5s.py in the xbar plugin folder. The script will execute every 5s. If the Zoom meeting is started, it will show the status ON and OFF when the Zoom meeting is done.
Create Automation
Go to Configuration > Automation and Add Automation to create automation using the binary_sensor.zoom.
Click Start with an Empty Automation.
Zoom_On
Every automation event has a name, trigger, condition and action. Let’s create the first one called Zoom_On. This automation is triggered when the Zoom meeting is started.
Under Triggers, select the entitiy binary_sensor.zoom and set “To” to on.
Under Conditions, we just leave it as it is for now.
Under Actions, we call a service media_player.volume_set to a minimum volume level with target the Family Room speaker which is my Google Home device.
Save and enable it.
Zoom_Off
Similar setup as above, we create Zoom_Off event to start playing the music on the Family Speaker when the Zoom meeting is done.
Under Triggers, select the entitiy binary_sensor.zoom and set “To” to off.
Under Conditions, we just leave it as it is for now.
Under Actions, we call a service media_player.volume_set to a desired volume level with target the Family Room speaker.
Don’t forget to save and enable it.
We are done with all the necessary setup.
https://github.com/ferrygun/HA_Zoom