I wanted to chime in here because I had the same exact need: to silence my interior chime during nap times. I’ve opened a request to have the functionality added to the official Python module that Home Assistant uses. However, in the meantime, here’s a super simple way to bundle all this up into one super switch.
- platform: command_line
switches:
doorbell_chime:
unique_id: doorbell_chime
friendly_name: Doorbell Chime
command_on: 'curl -s --digest -u admin:password "http://192.168.1.xxx/cgi-bin/configManager.cgi?action=setConfig&ExternalDoorBell.Enable=true"'
command_off: 'curl -s --digest -u admin:password "http://192.168.1.xxx/cgi-bin/configManager.cgi?action=setConfig&ExternalDoorBell.Enable=false"'
command_state: 'curl -s --digest -u admin:password "http://192.168.1.xxx/cgi-bin/configManager.cgi?action=getConfig&name=ExternalDoorBell.Enable"'
value_template: '{{ value.split("=")[1] == "true" }}'
icon_template: >
{% if value.split("=")[1] == "true" %} mdi:bell-ring
{% else %} mdi:bell-off
{% endif %}
This will give you a switch with an accurate state and allow you to toggle the chime, all in one go. Use it and build your automations!