Show the mirror in Home Assistant through your MQTT broker (such as the Mosquitto add-on): the screen, the sensors, the buttons and what your modules share, without any YAML. Home Assistant can only look until you let it control something below.
{% if cfg.enabled %}{% if status == "connected" %} Connected to {{ cfg.host }}. {% else %} {{ status | capitalize }}{% endif %}
{% if not cfg.username %}No user: a broker that lets the mirror in without one lets anyone in, and they can do all you allow below. Give the mirror a login of its own.
{% endif %} {% endif %} {% if cfg.enabled and cfg.id %}Every device logged in to your broker can send the mirror what you allow above. On a Mosquitto broker of your own, an ACL file with the lines below keeps the mirror's user to its own topics; give your other devices their own users and lines too. Home Assistant's Mosquitto add-on lets its own logins through whatever an ACL says, so there only the choices above hold: allow no more than you need.
user {{ cfg.username or "" }}
topic write mirrordash/{{ cfg.id }}/#
topic read mirrordash/{{ cfg.id }}/+/set
topic read mirrordash/{{ cfg.id }}/enabled/+/set
topic read mirrordash/{{ cfg.id }}/m/+/+/set
topic write homeassistant/device/{{ cfg.id }}/#
topic read homeassistant/status
Step by step in the user guide.