Message Types
Messages are used to communicate information between Mycroft services and other components. This list of Message types outlines the details and provides sample code for each.
Each Message type listed contains a description outlining it's meaning or purpose. Where relevant, the Message type will also list the specific JSON data packets expected to be emitted with that Message, and the most common producers and consumers of the Message.
See the MessageBus documentation for further information on this service and examples of using Messages.

General

speak

Request to speak utterance
Data:
1
{
2
"utterance": <words to be spoken>,
3
"lang": <language code, e.g. en-us>
4
}
Copied!
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('speak',
4
self.handler_speak)
5
6
def handler_speak(self, message):
7
# code to excecute when speak message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('speak',
4
{"utterance": <words to be spoken>,
5
"lang": <language code, e.g. en-us>}))
6
...
Copied!
1
python3 -m mycroft.messagebus.send 'speak' '{ "utterance": <words to be spoken>, "lang": <language code, e.g. en-us>}'
Copied!

mycroft.internet.connected

Internet connection is now available (only generated on initial connection)
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.internet.connected',
4
self.handler_mycroft_internet_connected)
5
6
def handler_mycroft_internet_connected(self, message):
7
# code to excecute when mycroft.internet.connected message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.internet.connected'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.internet.connected'
Copied!

mycroft.ready

Sent by start-up sequence when everything is ready for user interaction
Producer
Consumer
skills/padatious_service.py
Pairing Skill
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.ready',
4
self.handler_mycroft_ready)
5
6
def handler_mycroft_ready(self, message):
7
# code to excecute when mycroft.ready message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.ready'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.ready'
Copied!

mycroft.stop

Stop command (e.g. button pressed)
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.stop',
4
self.handler_mycroft_stop)
5
6
def handler_mycroft_stop(self, message):
7
# code to excecute when mycroft.stop message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.stop'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.stop'
Copied!

mycroft.not.paired

Start the pairing process when this event is emitted.
Producer
Consumer
Pairing Skill
Weather Skill
Wolfram Alpha Skill
Pairing Skill
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.not.paired',
4
self.handler_mycroft_not_paired)
5
6
def handler_mycroft_not_paired(self, message):
7
# code to excecute when mycroft.not.paired message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.not.paired'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.not.paired'
Copied!

mycroft.paired

Pairing has completed
Producer
Consumer
Pairing Skill
skills/skill_manager.py
enclosure/mark1/__init__.py
enclosure/generic/__init__.py
client/speech/__main__.py
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.paired',
4
self.handler_mycroft_paired)
5
6
def handler_mycroft_paired(self, message):
7
# code to excecute when mycroft.paired message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.paired'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.paired'
Copied!

mycroft.awoken

Has come out of sleep mode
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.awoken',
4
self.handler_mycroft_awoken)
5
6
def handler_mycroft_awoken(self, message):
7
# code to excecute when mycroft.awoken message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.awoken'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.awoken'
Copied!

mycroft.debug.log

log level can be: "CRITICAL" "ERROR" "WARNING" "INFO" "DEBUG" These correspond to the Python logging object.
The "bus" parameter allows turning the logging of all bus messages on/off.
Data:
1
{
2
"level" : <log level>,
3
"bus": <True/False>
4
}
Copied!
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.debug.log',
4
self.handler_mycroft_debug_log)
5
6
def handler_mycroft_debug_log(self, message):
7
# code to excecute when mycroft.debug.log message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.debug.log',
4
{
5
"level" : <log level>,
6
"bus": <True/False>}))
7
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.debug.log' '{ "level" : <log level>, "bus": <True/False>}'
Copied!

complete_intent_failure

Intent processing failed
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('complete_intent_failure',
4
self.handler_complete_intent_failure)
5
6
def handler_complete_intent_failure(self, message):
7
# code to excecute when complete_intent_failure message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('complete_intent_failure'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'complete_intent_failure'
Copied!

configuration.updated

Notification to services that the configuration has changed and needs reloaded
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('configuration.updated',
4
self.handler_configuration_updated)
5
6
def handler_configuration_updated(self, message):
7
# code to excecute when configuration.updated message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('configuration.updated'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'configuration.updated'
Copied!

Recognizer

recognizer_loop:wakeword

Wakeword was heard
Data:
1
{
2
"utterance": <wakeword heard>,
3
"session": <session ID>,
4
}
Copied!
Producer
Consumer
client/speech/main.py
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('recognizer_loop:wakeword',
4
self.handler_wakeword)
5
6
def handler_wakeword(self, message):
7
# code to excecute when recognizer_loop:wakeword message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('recognizer_loop:wakeword',
4
{"utterance": <wakeword heard>,
5
"session": <session ID>,}
6
))
7
...
Copied!
1
python3 -m mycroft.messagebus.send 'recognizer_loop:wakeword' '{ "utterance": <wakeword heard>, "session": <session ID>,}'
Copied!

recognizer_loop:record_begin

Recording has started
Producer
Consumer
client/speech/main.py
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('recognizer_loop:record_begin',
4
self.handler_record_begin)
5
6
def handler_record_begin(self, message):
7
# code to excecute when recognizer_loop:record_begin message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('recognizer_loop:record_begin'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'recognizer_loop:record_begin'
Copied!

recognizer_loop:record_end

Recording has ended
Producer
Consumer
client/speech/main.py
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('recognizer_loop:record_end',
4
self.handler_record_end)
5
6
def handler_record_end(self, message):
7
# code to excecute when recognizer_loop:record_end message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('recognizer_loop:record_end'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'recognizer_loop:record_end'
Copied!

recognizer_loop:utterance

STT has detected the given text or text was injected as an utterance via the CLI.
Data:
1
{
2
"utterances": [text],
3
"lang": self.stt.lang,
4
"session": session_id
5
}
Copied!
Producer
Consumer
client/speech/__main__.py
client/speech/listener.py
client/text/text_client.py
skills/__main__.py
client/text/text_client.py
messagebus/client/client.py
skills/intent_service.py
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('recognizer_loop:utterance',
4
self.handler_utterance)
5
6
def handler_utterance(self, message):
7
# code to excecute when recognizer_loop:utterance message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('recognizer_loop:utterance',
4
{"utterances": [text],
5
"lang": self.stt.lang,
6
"session": session_id}))
7
...
Copied!
1
python3 -m mycroft.messagebus.send 'recognizer_loop:utterance' '{ "utterances": [text], "lang": self.stt.lang, "session": session_id}'
Copied!

recognizer_loop:audio_output_start

Text output (TTS) has begun
Producer
Consumer
audio/speech.py
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('recognizer_loop:audio_output_start',
4
self.handler_audio_output_start)
5
6
def handler_audio_output_start(self, message):
7
# code to excecute when recognizer_loop:audio_output_start message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('recognizer_loop:audio_output_start'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'recognizer_loop:audio_output_start'
Copied!

recognizer_loop:audio_output_end

Text output (TTS) has ended
Producer
Consumer
audio/speech.py
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('recognizer_loop:audio_output_end',
4
self.handler_audio_output_end)
5
6
def handler_audio_output_end(self, message):
7
# code to excecute when recognizer_loop:audio_output_end message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('recognizer_loop:audio_output_end'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'recognizer_loop:audio_output_end'
Copied!

recognizer_loop:sleep

Go into "sleep" mode. Everything except "Hey Mycroft, wake up" will be ignored.
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('recognizer_loop:sleep',
4
self.handler_sleep)
5
6
def handler_sleep(self, message):
7
# code to excecute when recognizer_loop:sleep message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('recognizer_loop:sleep'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'recognizer_loop:sleep'
Copied!

recognizer_loop:wake_up

Come out of "sleep" mode.
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('recognizer_loop:wake_up',
4
self.handler_wake_up)
5
6
def handler_wake_up(self, message):
7
# code to excecute when recognizer_loop:wake_up message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('recognizer_loop:wake_up'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'recognizer_loop:wake_up'
Copied!

Enclosure

enclosure.notify.no_internet

Detected a connection error during STT
Producer
Consumer
audio/speech.py
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('enclosure.notify.no_internet',
4
self.handler_enclosure_notify_no_internet)
5
6
def handler_enclosure_notify_no_internet(self, message):
7
# code to excecute when enclosure.notify.no_internet message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('enclosure.notify.no_internet'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'enclosure.notify.no_internet'
Copied!

enclosure.mouth.viseme_list

start: timestamp for audio starts (unix epoch) END_TIME: time in seconds from "start" until the end of the viseme CODE can be 0 = shape for sounds like 'y' or 'aa' 1 = shape for sounds like 'aw' 2 = shape for sounds like 'uh' or 'r' 3 = shape for sounds like 'th' or 'sh' 4 = neutral shape for no sound 5 = shape for sounds like 'f' or 'v' 6 = shape for sounds like 'oy' or 'ao'
Data:
1
{
2
"start": timestamp,
3
"visemes": [[CODE,END_TIME],...]
4
}
Copied!
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('enclosure.mouth.viseme_list',
4
self.handler_enclosure_mouth_viseme_list)
5
6
def handler_enclosure_mouth_viseme_list(self, message):
7
# code to excecute when enclosure.mouth.viseme_list message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('enclosure.mouth.viseme_list',
4
{
5
"start": timestamp,
6
"visemes": [[CODE,END_TIME],...]}))
7
...
Copied!
1
python3 -m mycroft.messagebus.send 'enclosure.mouth.viseme_list' '{ "start": timestamp, "visemes": [[CODE,END_TIME],...]}'
Copied!

mycroft.eyes.default

Change eyes to default color
Producer
Consumer
mycroft-mark-1
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.eyes.default',
4
self.handler_mycroft_eyes_default)
5
6
def handler_mycroft_eyes_default(self, message):
7
# code to excecute when mycroft.eyes.default message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.eyes.default'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.eyes.default'
Copied!

Microphone Behavior

mycroft.mic.listen

Begin recording for STT processing
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.mic.listen',
4
self.handler_mycroft_mic_listen)
5
6
def handler_mycroft_mic_listen(self, message):
7
# code to excecute when mycroft.mic.listen message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.mic.listen'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.mic.listen'
Copied!

mycroft.mic.mute

Turn off the mic (no wakeword or STT processing)
Producer
Consumer
Pairing Skill
client/speech/main.py
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.mic.mute',
4
self.handler_mycroft_mic_mute)
5
6
def handler_mycroft_mic_mute(self, message):
7
# code to excecute when mycroft.mic.mute message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.mic.mute'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.mic.mute'
Copied!

mycroft.mic.unmute

Turn on the mic (enable wakeword and STT processing)
Producer
Consumer
Pairing Skill
client/speech/main.py
Usage:
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.mic.unmute',
4
self.handler_mycroft_mic_unmute)
5
6
def handler_mycroft_mic_unmute(self, message):
7
# code to excecute when mycroft.mic.unmute message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.mic.unmute'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.mic.unmute'
Copied!

Audio Playback

mycroft.audio.service.play

Start playback of tracklist
Producer
Consumer
skills/audioservice.py
playback-control
audio/main.py
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.audio.service.play',
4
self.handler_mycroft_audio_service_play)
5
6
def handler_mycroft_audio_service_play(self, message):
7
# code to excecute when mycroft.audio.service.play message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.audio.service.play'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.audio.service.play'
Copied!

mycroft.audio.service.stop

Stop playback
Producer
Consumer
skills/audioservice.py
playback-control
audio/main.py
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.audio.service.stop',
4
self.handler_mycroft_audio_service_stop)
5
6
def handler_mycroft_audio_service_stop(self, message):
7
# code to excecute when mycroft.audio.service.stop message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.audio.service.stop'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.audio.service.stop'
Copied!

mycroft.audio.service.pause

Pause playback (if supported)
Producer
Consumer
skills/audioservice.py
playback-control
audio/main.py
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.audio.service.pause',
4
self.handler_mycroft_audio_service_pause)
5
6
def handler_mycroft_audio_service_pause(self, message):
7
# code to excecute when mycroft.audio.service.pause message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.audio.service.pause'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.audio.service.pause'
Copied!

mycroft.audio.service.resume

Resume playback (if supported by backend)
Producer
Consumer
skills/audioservice.py
playback-control
audio/main.py
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.audio.service.resume',
4
self.handler_mycroft_audio_service_resume)
5
6
def handler_mycroft_audio_service_resume(self, message):
7
# code to excecute when mycroft.audio.service.resume message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.audio.service.resume'))
4
...
Copied!
1
python3 -m mycroft.messagebus.send 'mycroft.audio.service.resume'
Copied!

mycroft.audio.service.next

Skip to next track
Producer
Consumer
skills/audioservice.py
playback-control
audio/main.py
Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
1
...
2
def initialize(self):
3
self.add_event('mycroft.audio.service.next',
4
self.handler_mycroft_audio_service_next)
5
6
def handler_mycroft_audio_service_next(self, message):
7
# code to excecute when mycroft.audio.service.next message detected...
8
...
Copied!
1
...
2
def some_method(self):
3
self.bus.emit(Message('mycroft.audio.service.next'))