I would like to implement a Mycroft skill that can notify users when some external event occurs. For example, when the clothes are done drying, Mycroft will “speak” the notification “Clothes are ready”.
Is something like this possible? If so, what protocol is recommended for sending/broadcasting messages which mycroft can process?
Any other guidance to point me in the right direction for developing such a skill would be greatly appreciated (e.g. useful mycroft APIs/libraries).
@pcwii, what is the current status of your skill? I have installed it, however, I am not able to successfully see any mqtt message handled by the skill.
In settingsmeta.json, I have:
base_topic = Mycroft,
broker_address = 127.0.0.1 (broker installed on same pi as my one picroft)
location_id = basement
On the picroft terminal, I execute
mosquitto_pub -f ~/mesh_message.txt -t “Mycroft/Re
moteDevices/basement/” -d
where mesh_message.txt is
{
“source”:“basement”,
“command”:“speak hello”
}
But it does not appear that the mesh-skill is picking up the message. I see no output in skills.log. Should I? Any thoughts on how I might debug this further?
@screamnAbdab, Welcome to Alpha testing I only installed the skill myself for the first time last evening and did quite a few updates to the repo to get it to run at all. I plan on doing more tonight if I find the time. Once I give it a passing grade I will officially release it to the community in a new post.
A few things to test.
You definitely should have something in the skills log.
Make sure you have the mqtt enabled in the skill settings web gui
Make sure you are using a valid port
every mycroft request and response should be published to a topic
22:04:30.986 | INFO | 670 | mesh-skill_pcwii:handle_utterances:139 | what time is it
22:04:31.030 | INFO | 670 | mesh-skill_pcwii:send_MQTT:171 | MQTT: Mycroft/RemoteDevices/b827eb534955/request, what time is it
22:04:31.191 | INFO | 670 | mesh-skill_pcwii:send_MQTT:173 | address: 192.168.0.43, Port: 1883
22:04:31.551 | INFO | 670 | mesh-skill_pcwii:handle_speak:148 | Mycroft/RemoteDevices/b827eb534955/response
22:04:31.570 | INFO | 670 | mesh-skill_pcwii:handle_speak:152 | It is five oh four
22:04:31.594 | INFO | 670 | mesh-skill_pcwii:send_MQTT:171 | MQTT: Mycroft/RemoteDevices/b827eb534955/response, It is five oh four
22:04:31.606 | INFO | 670 | mesh-skill_pcwii:send_MQTT:173 | address: 192.168.0.43, Port: 1883
If the skill loaded properly you should be able to issue the following command…
Hey mycroft…Send a remote message
and it will walk you through the dialog.
when the skill loaded it should have created the following log entries
2020-01-03 02:23:30.444 | INFO | 670 | mesh-skill_pcwii:on_websettings_changed:110 | Websettings Changed! 192.168.0.43, 1883
2020-01-03 02:23:30.451 | INFO | 670 | mesh-skill_pcwii:get_mac_address:129 | MQTT using UUID: b827eb534955
2020-01-03 02:23:30.467 | INFO | 670 | mesh-skill_pcwii:mqtt_init:114 | MQTT Is Enabled
2020-01-03 02:23:30.472 | INFO | 670 | mesh-skill_pcwii:mqtt_init:116 | Connecting to host: 192.168.0.43, on port: 1883
2020-01-03 02:23:30.480 | INFO | 670 | mesh-skill_pcwii:mqtt_init:119 | MQTT Loop Started Successfully
2020-01-03 02:23:30.503 | INFO | 670 | mycroft.skills.skill_loader:_communicate_load_status:278 | Skill mesh-skill.pcwii loaded successfully
2020-01-03 02:23:30.510 | INFO | 670 | mycroft.skills.skill_manager:put:73 | Updating settings meta during runtime...
2020-01-03 02:23:30.514 | INFO | 670 | mesh-skill_pcwii:on_connect:59 | Connection Verified
2020-01-03 02:23:30.522 | INFO | 670 | mesh-skill_pcwii:on_connect:63 | Mesh-Skill Subscribing to: Mycroft/RemoteDevices/basement
If i get a chance I will do more testing on my end.
Working well for me now, thanks! I am having issues with skill settings so I made a small local modification, setting MQTT_Enabled to True by default in code.
I think this is going to be a very useful skill. Great job!
-Ben