Getting Mycroft to control my lights

I am attempting to get Mycroft to control my house lights.

The approach I have decided on is to set up a Raspberry Pi 3 running OpenHAB and then get Mycroft to operate the Pi.

So far, I have OpenHAB running, and have it recognizing my TP-Link light switches (though I did have to convince it to talk to a model it does not officially support, I’ll find out if this works later).

Next I have to figure out how to get OpenHAB to actually allow control, which I am currently trying to dig out of the documentation. Once I have that going, I plan to install the OpenHAB skill on Mycroft and see if I can voice-control my lights.

Activity control is going to be spread out among devices. Schedules will be stored in the switches, reactive automation will be handled by OpenHAB, and voice commands handled by Mycroft. If I can make it all work.

I mention all this because someone is likely to have useful suggestions, and when this is done, it can all be documented for the next person messing about with TP-Link switches.

I am trying something like that - though I am using homessistant. It is made whith phyton like Mycroft, so i do better understand it :wink:

I want all woice to be handled by Mycroft - and all knoleged skills and stuf like that, but homeautomation done by homeassistant. Homeassistan is connected to and controling everything, and Mcroft kan then control it by voice throu homeassistant.

But I am a long way, but did manage to get lights and thermostats and music working by voice whith mycroft.Ohh and also getting a notification from Mycroft when a plant needs wather :slight_smile:

But right now, it dosnt. I am waiting for homeassistant skill to get to 18.2 branch

But it is really fun

I am interested in both of your projects but I am trying to understand the benefits of using home assist and/or openhab when I currently have built skills to control my Yeelights, nanoleaf Aurora, leviton dimmer, and hyperion lights. Are there additional benefits that I should be aware of outside of my current methods?

I am sorry to break the bad news, but the author of the homeassistant skill is no longer supporting it:

I am using FHEM (a GPL’d perl server for house automation which has a small but active user base in Germany) and want to integrate my Mycroft Mark I with it. Right now I am analyzing the skills for Domoticz, Homeassistant, OpenHAB, ESP8266 and MQTT to get an idea what will be the best way to integrate.

So far I have concluded to keep the automation logic in FHEM (resp. the home automation system of your choice) and use Mycroft as Voice-to-text device only as there is way more to control than light switches, for example I have temperature sensor, water pump and heating thermostats controled by it as well. This will be too complex to build as Mycroft skill

1 Like

Ohh thats not good news. I would fork and make the transistant to phyton if I could, but I am not that good at programming :frowning: I only do try and error and often dont know why something is working :wink:

I’ve backed the latest kickstarter and dont yet have a mycroft.

I have though been using openhab for some time.

OpenHab’s REST API allows items to be controlled by http commands. There are lots of people in the OpenHab forum who would help with this.

Looking at the existing Mycroft OpenHab skill, i have been hoping it wont be too difficult to add more commands. I recognise this might be wishful thinking!

I’ll check out the forum. I am presently trying to figure out what to do with my switches now that I have them recognized as on-line. I have three switches recognized as Things and Items, I’m figuring out what to do next. Im not sure I’m doing Items right. Whee!

The “things” and “items” separation can be confusing at first, but it makes increasing sense as you have more automations.

I think of Things as the physical objects / websites etc. Each of these might have a number of “channels” - that is, sources of information - for reading information or making changes to.

Items are the things you identify you want to read or change either in a GUI or through rules.

So… the zwave switches i have have channels for on-off and power consumption. I have an item set for the switch, but i dont use the power consumption so i havent set an item for that channel.

Youll need items for anything you want to control by mycroft as you can change them with an http request

Reviving this due to success.

At some point, my original OpenHAB took an upgrade that wiped all the data. I installed a new download, and slogged my way through. I now have Mycroft able to turn my various lights on and off on command.

A couple of bits of data to save time for others on this sort of project:

For the OpenHAB skill, item tags are important. I have my switches tagged as “Switchable” and “Lighting”. Forget the right tag and Mycroft won’t recognize the lights. I think “Switchable” is the important one here, I haven’t tested that yet.

On the Mark 1 I have, using find to locate mycroft.conf does not find the correct file. I found it at /etc/mycroft/mycroft.conf

When adding the stanza for the OpenHAB skill to the mycroft.conf file, note the structure, I found commas after all but the last skill stanza, so when I added the OpenHAB entry, I made sure to add a comma after the end } of the prior skill. Remember to restart Mycroft before trying to use the skill.

If your router provides DNS you can use the name of your OpenHAB controller instead of the IP address.

While typing this up I’ve been telling Mycroft to turn various lights on and off and it has been working perfectly, if a bit slowly.

Now to create some groups and see if Mycroft will work with them.
[Happy camper mode ON]