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:

...
def initialize(self):
    self.add_event('speak',
                   self.handler_speak)

def handler_speak(self, message):
    # code to excecute when speak message detected...
...

mycroft.internet.connected

Internet connection is now available (only generated on initial connection)

Usage:

mycroft.ready

Sent by start-up sequence when everything is ready for user interaction

Producer

Consumer

skills/padatious_service.py

Pairing Skill

Usage:

mycroft.stop

Stop command (e.g. button pressed)

Usage:

mycroft.not.paired

Start the pairing process when this event is emitted.

Producer

Consumer

Pairing Skill

Weather Skill

Wolfram Alpha Skill

Pairing Skill

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

mycroft.awoken

Has come out of sleep mode

Usage:

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:

Usage:

complete_intent_failure

Intent processing failed

Usage:

configuration.updated

Notification to services that the configuration has changed and needs reloaded

Usage:

Recognizer

recognizer_loop:wakeword

Wakeword was heard

Data:

Producer

Consumer

client/speech/main.py

Usage:

recognizer_loop:record_begin

Recording has started

Producer

Consumer

client/speech/main.py

Usage:

recognizer_loop:record_end

Recording has ended

Producer

Consumer

client/speech/main.py

Usage:

recognizer_loop:utterance

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

Data:

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

recognizer_loop:audio_output_start

Text output (TTS) has begun

Producer

Consumer

audio/speech.py

Usage:

recognizer_loop:audio_output_end

Text output (TTS) has ended

Producer

Consumer

audio/speech.py

Usage:

recognizer_loop:sleep

Go into "sleep" mode. Everything except "Hey Mycroft, wake up" will be ignored.

Usage:

recognizer_loop:wake_up

Come out of "sleep" mode.

Usage:

Enclosure

enclosure.notify.no_internet

Detected a connection error during STT

Producer

Consumer

audio/speech.py

Usage:

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:

Usage:

mycroft.eyes.default

Change eyes to default color

Producer

Consumer

mycroft-mark-1

Usage:

Microphone Behavior

mycroft.mic.listen

Begin recording for STT processing

Usage:

mycroft.mic.mute

Turn off the mic (no wakeword or STT processing)

Producer

Consumer

Pairing Skill

client/speech/main.py

Usage:

mycroft.mic.unmute

Turn on the mic (enable wakeword and STT processing)

Producer

Consumer

Pairing Skill

client/speech/main.py

Usage:

Audio Playback

mycroft.audio.service.play

Start playback of tracklist

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

mycroft.audio.service.stop

Stop playback

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

mycroft.audio.service.pause

Pause playback (if supported)

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

mycroft.audio.service.resume

Resume playback (if supported by backend)

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

mycroft.audio.service.next

Skip to next track

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

mycroft.audio.service.prev

Skip to previous track

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

mycroft.audio.service.track_info

Request track info from audio service

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

mycroft.audio.service.track_info_reply

Reply to track info request

Producer

Consumer

audio/main.py

skills/audioservice.py

Usage:

mycroft.audio.service.list_backends

Returns list of available backends.

Producer

Consumer

skills/audioservice.py

audio/main.py

Usage:

Volume Control

mycroft.volume.increase

Enclosure Volume up

Data:

Producer

Consumer

client/enclosure/__init__.py

Volume Skill

Usage:

mycroft.volume.decrease

Enclosure Volume down

Data:

Producer

Consumer

client/enclosure/__init__.py

Volume Skill

Usage:

mycroft.volume.mute

Enclosure Volume muted

Data:

Producer

Consumer

skill-naptime

Volume Skill

Usage:

mycroft.volume.unmute

Enclosure Volume unmuted

Data:

Producer

Consumer

skill-naptime

Volume Skill

Usage:

mycroft.volume.set

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

Data:

Producer

Consumer

Volume Skill

Usage:

mycroft.volume.get

Request volume level

Usage:

mycroft.volume.get.response

Data:

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

mycroft.volume.duck

Reduce the volume level temporarily

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

mycroft.volume.unduck

Restore the volume level

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

Mycroft Skill Core

mycroft.skill.handler.start

Data:

Usage:

mycroft.skill.handler.complete

Usage:

mycroft.skill.enable_intent

Enable disabled intent

Data:

Producer

Consumer

mycroft/skills/core.py

Usage:

mycroft.skill.disable_intent

Disable intent

Data:

Producer

Consumer

mycroft/skills/core.py

Usage:

mycroft.skills.loaded

A Skill has been loaded

Data:

Producer

Consumer

skills/main.py

mycroft/skills/intent_service.py

Usage:

mycroft.skills.loading_failure

A Skill has failed to load

Data:

Producer

Consumer

skills/main.py

Usage:

mycroft.skills.shutdown

A Skill has shutdown

Data:

Producer

Consumer

skills/main.py

Usage:

mycroft.skills.initialized

Upon startup, all skills have been loaded

Producer

Consumer

mycroft/skills/skill_manager.py

mycroft/skills/padatious_service.py

Usage:

mycroft.skills.list

List of loaded skills (response to 'skillmanager.list')

Data:

Producer

Consumer

skills/main.py

Usage:

mycroft.skills.settings.update

Pull new skill settings from the server

Producer

Consumer

Configuration Skill

mycroft/skills/settings.py

Usage:

Mycroft Skill Manager (MSM)

msm.updating

MSM install has begun

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.installing

MSM update has begun

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.install.succeeded

MSM install succeeded for given skill

Data:

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.install.failed

MSM install failed for given skill

Data:

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.installed

MSM install is complete

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.updated

MSM update is complete

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.removing

MSM remove has begun

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.remove.succeeded

MSM remove succeeded for given skill

Data:

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.remove.failed

MSM remove failed for given skill

Data:

Producer

Consumer

msm.sh

skills/main.py

Usage:

msm.removed

MSM remove is complete

Producer

Consumer

msm.sh

skills/main.py

Usage:

Skill Manager

skillmanager.deactivate

Deactivate a skill. Activate by typing ":deactivate " in the CLI

Data:

Producer

Consumer

CLI (client/text/main.py)

skills/skill_manager.py

Usage:

skillmanager.list

List installed skills. Activate by typing ":list" in the CLI

Producer

Consumer

CLI (client/text/main.py)

skills/skill_manager.py

Usage:

skillmanager.update

Request immediate update of all skills

Producer

Consumer

skills/main.py

Usage:

Messagebus Connection

open

websocket connection has closed

Producer

Consumer

messagebus\client\ws.py

Usage:

close

websocket connection was lost, reconnecting

Producer

Consumer

messagebus\client\ws.py

Usage:

reconnecting

websocket connection has opened

Producer

Consumer

messagebus\client\ws.py

Usage:

System Administrative Actions

system.wifi.setup

Kick off a a wifi-setup session

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

system.wifi.reset

Clear the saved wifi settings

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

system.ntp.sync

Force the system clock to synchronize with NTP servers

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

system.ssh.enable

Configure system to allow SSH connections

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

system.ssh.disable

Configure system to block SSH connections

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

system.reboot

Force a Linux reboot

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

system.shutdown

Force a Linux shutdown

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

system.update

Force an apt-get update on 'mycroft-mark-1' or 'mycroft-picroft' package (as appropriate)

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

Common Play System

play:query

Data:

Usage:

play:query.response

There are three responses to a play:query. These are not intended to be consumed directly by a Skill, see the methods available in the CommonPlaySkill Class.

The initial response confirms that a search is being attempted. It also extends the Skill timeout while it looks for a match.

Data:

Search Result

Emitted if a result is found. Responses from the Play services must be received within 1 second to be included.

Data:

  • phrase - the phrase that was queried for this response

  • id - uniquely identifies the skill, normally the Skill's self.skill_id

  • callback_data - optional data structure to return in play:start

  • service_name - the name of the service returning the highest confidence in a speakable format

  • conf - the confidence it can handle the request, between 0.0 and 1.0

Confidence guidelines:

  • 1.0 = exact command match, e.g. "play npr news"

  • >0.9 = multi-key match for database entry, e.g. "play madonna's lucky star" or "play artist madona" (matches "artist" and "madonna"). For each additional key over 2, add 0.1 to the confidence, so "play madonna's lucky star on spotify" would be 0.91 for three keywords

  • >0.8 = single-key match for database title entry, e.g. "play lucky star"

  • >0.7 = single-key match for database artist or group, e.g. "play madonna"

  • >0.6 = single-key match for database genre or category, e.g. "play reggae"

  • >0.5 = generic match, e.g. "play some music" or "play a movie"

Search Failed

No suitable result was found.

Data:

play:start

  • skill_id -- the unique ID of the skill that is being invoked

  • phrase -- the original phrase user said, e.g. "some thing" from utterance "play some thing"

  • callback_data -- (optional) data the skill can use to start playback

Data:

Common Query System

question:query

Data:

Usage:

question:query.response

  • skill_id -- the unique ID of the skill that is being invoked

  • phrase -- the original phrase user said, e.g. "some thing" from utterance "how tall was abraham lincoln"

  • conf -- confidence level of answers validity

  • callback_data -- (optional) data the skill can use for any additional actions (such as image url or similar)

  • searching -- true if more time is needed to complete the search, otherwise false

Data:

Usage:

question:action

  • skill_id -- the unique ID of the skill that is being invoked

  • phrase -- the original phrase user said, e.g. "some thing" from utterance "how tall was abraham lincoln"

  • callback_data -- (optional) data the skill can use to take additional actions

Usage:

Mycroft Alarm Skill

private.mycroftai.has_alarm

Count of running alarms (0 == no alarms)

Data:

Usage:

PROPOSED

skill.namespace.*

e.g. "skill.mycroft.noftify.alarm_changed" or "skill.jaguar.notify.car_stopped"

Usage:

private.github_username.*

for private (not intended to be used by anyone else)

Usage:

Last updated

Was this helpful?