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:

{
"utterance": <words to be spoken>,
"lang": <language code, e.g. en-us>
}

Usage:

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

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.internet.connected',
self.handler_mycroft_internet_connected)
def handler_mycroft_internet_connected(self, message):
# code to excecute when mycroft.internet.connected message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.internet.connected'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.internet.connected'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.ready',
self.handler_mycroft_ready)
def handler_mycroft_ready(self, message):
# code to excecute when mycroft.ready message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.ready'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.ready'

mycroft.stop

Stop command (e.g. button pressed)

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.stop',
self.handler_mycroft_stop)
def handler_mycroft_stop(self, message):
# code to excecute when mycroft.stop message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.stop'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.stop'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.not.paired',
self.handler_mycroft_not_paired)
def handler_mycroft_not_paired(self, message):
# code to excecute when mycroft.not.paired message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.not.paired'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.not.paired'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.paired',
self.handler_mycroft_paired)
def handler_mycroft_paired(self, message):
# code to excecute when mycroft.paired message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.paired'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.paired'

mycroft.awoken

Has come out of sleep mode

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.awoken',
self.handler_mycroft_awoken)
def handler_mycroft_awoken(self, message):
# code to excecute when mycroft.awoken message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.awoken'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.awoken'

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:

{
"level" : <log level>,
"bus": <True/False>
}

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.debug.log',
self.handler_mycroft_debug_log)
def handler_mycroft_debug_log(self, message):
# code to excecute when mycroft.debug.log message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.debug.log',
{
"level" : <log level>,
"bus": <True/False>}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.debug.log' '{ "level" : <log level>, "bus": <True/False>}'

complete_intent_failure

Intent processing failed

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('complete_intent_failure',
self.handler_complete_intent_failure)
def handler_complete_intent_failure(self, message):
# code to excecute when complete_intent_failure message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('complete_intent_failure'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'complete_intent_failure'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('configuration.updated',
self.handler_configuration_updated)
def handler_configuration_updated(self, message):
# code to excecute when configuration.updated message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('configuration.updated'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'configuration.updated'

Recognizer

recognizer_loop:wakeword

Wakeword was heard

Data:

{
"utterance": <wakeword heard>,
"session": <session ID>,
}

Producer

Consumer

client/speech/main.py

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('recognizer_loop:wakeword',
self.handler_wakeword)
def handler_wakeword(self, message):
# code to excecute when recognizer_loop:wakeword message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('recognizer_loop:wakeword',
{"utterance": <wakeword heard>,
"session": <session ID>,}
))
...
Command line invocation
python3 -m mycroft.messagebus.send 'recognizer_loop:wakeword' '{ "utterance": <wakeword heard>, "session": <session ID>,}'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('recognizer_loop:record_begin',
self.handler_record_begin)
def handler_record_begin(self, message):
# code to excecute when recognizer_loop:record_begin message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('recognizer_loop:record_begin'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'recognizer_loop:record_begin'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('recognizer_loop:record_end',
self.handler_record_end)
def handler_record_end(self, message):
# code to excecute when recognizer_loop:record_end message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('recognizer_loop:record_end'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'recognizer_loop:record_end'

recognizer_loop:utterance

STT has detected the given text or text was injected as an utterance via the CLI.

Data:

{
"utterances": [text],
"lang": self.stt.lang,
"session": session_id
}

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('recognizer_loop:utterance',
self.handler_utterance)
def handler_utterance(self, message):
# code to excecute when recognizer_loop:utterance message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('recognizer_loop:utterance',
{"utterances": [text],
"lang": self.stt.lang,
"session": session_id}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'recognizer_loop:utterance' '{ "utterances": [text], "lang": self.stt.lang, "session": session_id}'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('recognizer_loop:audio_output_start',
self.handler_audio_output_start)
def handler_audio_output_start(self, message):
# code to excecute when recognizer_loop:audio_output_start message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('recognizer_loop:audio_output_start'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'recognizer_loop:audio_output_start'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('recognizer_loop:audio_output_end',
self.handler_audio_output_end)
def handler_audio_output_end(self, message):
# code to excecute when recognizer_loop:audio_output_end message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('recognizer_loop:audio_output_end'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'recognizer_loop:audio_output_end'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('recognizer_loop:sleep',
self.handler_sleep)
def handler_sleep(self, message):
# code to excecute when recognizer_loop:sleep message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('recognizer_loop:sleep'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'recognizer_loop:sleep'

recognizer_loop:wake_up

Come out of "sleep" mode.

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('recognizer_loop:wake_up',
self.handler_wake_up)
def handler_wake_up(self, message):
# code to excecute when recognizer_loop:wake_up message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('recognizer_loop:wake_up'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'recognizer_loop:wake_up'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('enclosure.notify.no_internet',
self.handler_enclosure_notify_no_internet)
def handler_enclosure_notify_no_internet(self, message):
# code to excecute when enclosure.notify.no_internet message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('enclosure.notify.no_internet'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'enclosure.notify.no_internet'

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:

{
"start": timestamp,
"visemes": [[CODE,END_TIME],...]
}

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('enclosure.mouth.viseme_list',
self.handler_enclosure_mouth_viseme_list)
def handler_enclosure_mouth_viseme_list(self, message):
# code to excecute when enclosure.mouth.viseme_list message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('enclosure.mouth.viseme_list',
{
"start": timestamp,
"visemes": [[CODE,END_TIME],...]}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'enclosure.mouth.viseme_list' '{ "start": timestamp, "visemes": [[CODE,END_TIME],...]}'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.eyes.default',
self.handler_mycroft_eyes_default)
def handler_mycroft_eyes_default(self, message):
# code to excecute when mycroft.eyes.default message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.eyes.default'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.eyes.default'

Microphone Behavior

mycroft.mic.listen

Begin recording for STT processing

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.mic.listen',
self.handler_mycroft_mic_listen)
def handler_mycroft_mic_listen(self, message):
# code to excecute when mycroft.mic.listen message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.mic.listen'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.mic.listen'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.mic.mute',
self.handler_mycroft_mic_mute)
def handler_mycroft_mic_mute(self, message):
# code to excecute when mycroft.mic.mute message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.mic.mute'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.mic.mute'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.mic.unmute',
self.handler_mycroft_mic_unmute)
def handler_mycroft_mic_unmute(self, message):
# code to excecute when mycroft.mic.unmute message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.mic.unmute'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.mic.unmute'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.play',
self.handler_mycroft_audio_service_play)
def handler_mycroft_audio_service_play(self, message):
# code to excecute when mycroft.audio.service.play message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.play'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.play'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.stop',
self.handler_mycroft_audio_service_stop)
def handler_mycroft_audio_service_stop(self, message):
# code to excecute when mycroft.audio.service.stop message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.stop'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.stop'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.pause',
self.handler_mycroft_audio_service_pause)
def handler_mycroft_audio_service_pause(self, message):
# code to excecute when mycroft.audio.service.pause message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.pause'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.pause'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.resume',
self.handler_mycroft_audio_service_resume)
def handler_mycroft_audio_service_resume(self, message):
# code to excecute when mycroft.audio.service.resume message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.resume'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.resume'

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
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.next',
self.handler_mycroft_audio_service_next)
def handler_mycroft_audio_service_next(self, message):
# code to excecute when mycroft.audio.service.next message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.next'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.next'

mycroft.audio.service.prev

Skip to previous track

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.prev',
self.handler_mycroft_audio_service_prev)
def handler_mycroft_audio_service_prev(self, message):
# code to excecute when mycroft.audio.service.prev message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.prev'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.prev'

mycroft.audio.service.track_info

Request track info from audio service

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.track_info',
self.handler_mycroft_audio_service_track_info)
def handler_mycroft_audio_service_track_info(self, message):
# code to excecute when mycroft.audio.service.track_info message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.track_info'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.track_info'

mycroft.audio.service.track_info_reply

Reply to track info request

Producer

Consumer

audio/main.py

skills/audioservice.py

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.track_info_reply',
self.handler_mycroft_audio_service_track_info_reply)
def handler_mycroft_audio_service_track_info_reply(self, message):
# code to excecute when mycroft.audio.service.track_info_reply message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.track_info_reply'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.track_info_reply'

mycroft.audio.service.list_backends

Returns list of available backends.

Producer

Consumer

skills/audioservice.py

audio/main.py

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.audio.service.list_backends',
self.handler_mycroft_audio_service_list_backends)
def handler_mycroft_audio_service_list_backends(self, message):
# code to excecute when mycroft.audio.service.list_backends message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.audio.service.list_backends'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.audio.service.list_backends'

Volume Control

mycroft.volume.increase

Enclosure Volume up

Data:

{"play_sound": True}

Producer

Consumer

client/enclosure/__init__.py

Volume Skill

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.increase',
self.handler_mycroft_volume_increase)
def handler_mycroft_volume_increase(self, message):
# code to excecute when mycroft.volume.increase message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.increase',
{"play_sound": True}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.increase' '{"play_sound": True}'

mycroft.volume.decrease

Enclosure Volume down

Data:

{"play_sound": True}

Producer

Consumer

client/enclosure/__init__.py

Volume Skill

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.decrease',
self.handler_mycroft_volume_decrease)
def handler_mycroft_volume_decrease(self, message):
# code to excecute when mycroft.volume.decrease message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.decrease',
{"play_sound": True}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.decrease' '{"play_sound": True}'

mycroft.volume.mute

Enclosure Volume muted

Data:

{"speak_message": True}

Producer

Consumer

skill-naptime

Volume Skill

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.mute',
self.handler_mycroft_volume_mute)
def handler_mycroft_volume_mute(self, message):
# code to excecute when mycroft.volume.mute message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.mute',
{"speak_message": True}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.mute' '{"speak_message": True}'

mycroft.volume.unmute

Enclosure Volume unmuted

Data:

{"speak_message": True}

Producer

Consumer

skill-naptime

Volume Skill

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.unmute',
self.handler_mycroft_volume_unmute)
def handler_mycroft_volume_unmute(self, message):
# code to excecute when mycroft.volume.unmute message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.unmute',
{"speak_message": True}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.unmute' '{"speak_message": True}'

mycroft.volume.set

Set enclosure volume (0.0 = no output, 1.0 = loudest possible)

Data:

{"percent": float}

Producer

Consumer

Volume Skill

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.set',
self.handler_mycroft_volume_set)
def handler_mycroft_volume_set(self, message):
# code to excecute when mycroft.volume.set message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.set',
{"percent": float}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.set' '{"percent": float}'

mycroft.volume.get

Request volume level

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.get',
self.handler_mycroft_volume_get)
def handler_mycroft_volume_get(self, message):
# code to excecute when mycroft.volume.get message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.get'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.get'

mycroft.volume.get.response

Data:

{
"percent": <volume percentage>,
"muted": <true/false>
}

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.get.response',
self.handler_mycroft_volume_get_response)
def handler_mycroft_volume_get_response(self, message):
# code to excecute when mycroft.volume.get.response message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.get.response',
{"percent": <volume percentage>,
"muted": <true/false>}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.get.response' '{ "percent": <volume percentage>, "muted": <true/false>}'

mycroft.volume.duck

Reduce the volume level temporarily

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.duck',
self.handler_mycroft_volume_duck)
def handler_mycroft_volume_duck(self, message):
# code to excecute when mycroft.volume.duck message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.duck'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.duck'

mycroft.volume.unduck

Restore the volume level

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.volume.unduck',
self.handler_mycroft_volume_unduck)
def handler_mycroft_volume_unduck(self, message):
# code to excecute when mycroft.volume.unduck message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.volume.unduck'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.volume.unduck'

Mycroft Skill Core

mycroft.skill.handler.start

Data:

{handler: class/function name}

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.skill.handler.start',
self.handler_mycroft_skill_handler_start)
def handler_mycroft_skill_handler_start(self, message):
# code to excecute when mycroft.skill.handler.start message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.skill.handler.start',
{handler: class/function name}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.skill.handler.start' '{handler: class/function name}'

mycroft.skill.handler.complete

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.skill.handler.complete',
self.handler_mycroft_skill_handler_complete)
def handler_mycroft_skill_handler_complete(self, message):
# code to excecute when mycroft.skill.handler.complete message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.skill.handler.complete'))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.skill.handler.complete'

mycroft.skill.enable_intent

Enable disabled intent

Data:

{"intent_name": "name"}

Producer

Consumer

mycroft/skills/core.py

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.skill.enable_intent',
self.handler_mycroft_skill_enable_intent)
def handler_mycroft_skill_enable_intent(self, message):
# code to excecute when mycroft.skill.enable_intent message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.skill.enable_intent',
{"intent_name": "name"}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.skill.enable_intent' '{"intent_name": "name"}'

mycroft.skill.disable_intent

Disable intent

Data:

{"intent_name": "name"}

Producer

Consumer

mycroft/skills/core.py

Usage:

Message handler in MycroftSkill
Generating Message from MycroftSkill
Command line invocation
Message handler in MycroftSkill
...
def initialize(self):
self.add_event('mycroft.skill.disable_intent',
self.handler_mycroft_skill_disable_intent)
def handler_mycroft_skill_disable_intent(self, message):
# code to excecute when mycroft.skill.disable_intent message detected...
...
Generating Message from MycroftSkill
...
def some_method(self):
self.bus.emit(Message('mycroft.skill.disable_intent',
{"intent_name": "name"}))
...
Command line invocation
python3 -m mycroft.messagebus.send 'mycroft.skill.disable_intent'