Why not? Because I’m very new to HA and didn’t know you could do that! 
Thanks for the tips! It’s working as-is, but I may utilize some of your improvements. I’m not entirely happy with the “In” being capitalized when mode == ‘off’, but could easily overcome that. Also don’t like the hard-coded reference to the input_boolean id in the script.
Maybe I could make the ‘publish’ script more generic and put data variables in for the topic and potentially the appropriate input_boolean as well (if I end up having more than one, which is entirely possible).
Wondering if this would work (not yet deployed/tested):
mqtt_input_boolean_notification:
alias: 'Publish MQTT Notification from Input Boolean'
sequence:
- service: mqtt.publish
data:
topic: "home-assistant/{{generic.parent_topic}}/{{generic.board_number}}/{{generic.sub_topic}}"
payload: >
{ "message": "{{message}}", "action": "{{mode}}" }
- service: 'input_boolean.turn_{{mode}}'
target:
entity_id: input_boolean.{{generic.input_id}}
Not sure about the “generic data” definition - theoretically this should work. The YAML passes validation (Best YAML Validator Online)
meetings_board_generic_data:
parent_topic: 'message-board'
board_number: 1
sub_topic: 'meetings'
input_id: 'in_a_meeting'
switch:
- platform: template
switches:
in_a_meeting:
friendly_name: In a Meeting
value_template: "{{ is_state('input_boolean.in_a_meeting', 'on') }}"
turn_on:
- service: script.mqtt_input_boolean_notification
data:
generic: meetings_board_generic_data
mode: 'on'
message: 'In a meeting'
turn_off:
- service: script.mqtt_input_boolean_notification
data:
generic: meetings_board_generic_data
mode: 'off'
message: 'Not in a meeting'
The end-goal is to have the message text displayed on an AdaFruit 64x32 LED Matrix that subscribes to that feed. I’ve been working from home since March of 2020 and am in and out of virtual meetings and calls all day. I close my door when I’m on the call, but then when I’m available I don’t always open my door immediately. Having the board outside my home office will help my family know not to disturb me, or if I’m available (as long as I remember to toggle the switch
). Stretch goal is to hook it up to my MS Teams account so it can automatically publish the notifications based on my status, but I don’t know if my job will allow me access to the API.
I have the hardware set up, just need to write the script to process the notification payload. I want to make that script as generic as possible, too, which is why I have it delineated by parent_topic, board_number, and sub_topic so if I create a second board with the same setup but different configuration it can be hooked up to a different template switch, input boolean, and topic (say, if my daughter wanted to have one on her bedroom door).