Skill Hue lighting [Solved]

I’ve got Mycroft installed and running on a Raspberry Pi 3. I just flashed the image and logged in. What I’d really like to do is have mycroft turn the lights on and off. But the skills seems very confusing. I read that it should go in /opt/mycroft/skills or other places say /home/mycroft/.mycroft/skills

Under /home/mycroft/.mycroft/skills I have a bunch of folders (PhillipsHueSkill) but there’s nothing in any of these folders. Also I tried installing the phillips hue still my running
msm install https://github.com/ChristopherRogers1991/mycroft-hue.git

But that doesn’t seem to have any effect either as mycroft still doesn’t recognize any phrase with ‘lights’. Am I missing something obvious about skills? I even checked the logs in /var/log/mycroft-skills.log and don’t see anything obvious in there either. Its probably posted somewhere obvious and I’m just missing it…

Thanks

Can’t seem to figure out how to delete my post.

In any case what I ended up having to do was the following.

Did the msm install again. Checked the files, rebooted. In the skills/mycroft-hue directory there was a readme. I’d tried it previously but I could not the the mycroft.conf file to work with its default values for mimic and the phillips hue section I needed to put in there. Decided to just rip out the mimic section and leave the mycroft.conf file with only the phillips hue section. Rebooted, asked mycroft to ‘lights on’ and he said to press the button on the hub and I was all set. Very cool

I think I have a slightly better handle on skills now. Pretty nifty.

I’m glad to hear you figured it out. Which mycroft.conf file did you end up editing? And was this on a Raspberry Pi?

This was on a Raspberry Pi 3

I ended up editing /home/mycroft/.mycroft/mycroft.conf

It had the default lines of

{
“tts”: {
“module”: “mimic”,
“mimic”: {
“voice”: “ap”,
“path”:"/usr/local/bin/mimic"
}
}
}

I had to remove all those lines and put in
{
“PhillipsHueSkill”: {
“ip”: “”,
“username”: “”,
“verbose”: false,
“brightness_step”: 50,
“color_temperature_step”: 1000,
“default_group”: 0
}
}

I was using the yaml checker and couldn’t find any way to combine the two. But it appears to work

There’s also a newer hue skill now, https://github.com/Geeked-Out-Solutions/mycroft-hue (slightly less config needed)

This skill appears to have broken with the python 3.4 upgrade
Any thoughts on how to fix it?

Hi @adamc1999 what specifically isn’t working with it? Do you have any mycroft-skill.log entries that might help us troubleshoot?

Yes. Upon config load, the skill fails because it cannot find the module “phue”


return load_source(name, filename, file)
File “/opt/venvs/mycroft-core/lib/python3.4/imp.py”, line 171, in load_source
module = methods.load()
File “”, line 1220, in load
File “”, line 1200, in _load_unlocked
File “”, line 1129, in _exec
File “”, line 1471, in exec_module
File “”, line 321, in _call_with_frames_removed
File “/opt/mycroft/skills/mycroft-hue/init.py”, line 24, in
from phue import Bridge
ImportError: No module named ‘phue’

Yet I checked and phue is definitely installed
pi@mark_1:~/skills/mycroft-hue $ pip list
chardet (2.3.0)
colorama (0.3.2)
configparser (3.5.0)
fuzzywuzzy (0.16.0)
html5lib (0.999)
phue (1.0)
pip (1.5.6)
python-apt (0.9.3.12)
python-debian (0.1.27)
python-Levenshtein (0.12.0)
requests (2.4.3)
setuptools (5.5.1)
six (1.8.0)
ufw (0.33-2)
urllib3 (1.9.1)
wheel (0.24.0)

Maybe there is a problem with my python install?
modules not in the expected directory?

you’ll have to add the phue module to the python3 env. Try “pip3 list”. Or “pip3 install phue”. (phue is compatible per github: phue works with Python 2.6.x, 2.7.x and 3.x)

In the log I posted above is output of pip3 list and phue is listed
I’m very inexperienced with python and coding in general. But it looks like there is an issue finding the module based on os.path possibly?

You have pip list, not pip3 list. They’re distinct in all the distros I’ve seen.

pi@mark_1:~/skills $ sudo pip3 list
chardet (2.3.0)
colorama (0.3.2)
configparser (3.5.0)
fuzzywuzzy (0.16.0)
html5lib (0.999)
phue (1.0)
pip (1.5.6)
python-apt (0.9.3.12)
python-debian (0.1.27)
python-Levenshtein (0.12.0)
requests (2.4.3)
setuptools (5.5.1)
six (1.8.0)
ufw (0.33-2)
urllib3 (1.9.1)
wheel (0.24.0)

if you’re not in the venv for mycroft, this is reporting the system packages. Try “workon mycroft” and then “pip3 list”.

You were correct. The new architecture requires installing in the venv
I worked with the dev on getting my system back up and running which requires a modification to the __init.py file as well.
He’ll probably have it ready and approved for msm install within the week (approval from mycroft ai could vary this timeline)

Thanks for your help!

AC

1 Like