openhab / openhab-mycroft

Mycroft skill for openHAB
Eclipse Public License 2.0
20 stars 45 forks source link

Mycroft - openhab not hearing/understanding #49

Closed NathanLKing closed 6 years ago

NathanLKing commented 6 years ago

Howdy!

I've installed your cool Skill and I'm hoping to get it working.

openHAB is functioning correctly via a sitemap I've created and using their basicui.

I've installed this Skill into Mycroft. I've installed HomeKit. I've added an .items file which includes various items, I had to add another one as appending the 'tags' to the original .items folder disabled the functionality. An example of an item in the .items folder: Switch BedCFLight "Bedroom Fan Light" [ "Switchable" ]

Mycroft knows that your Skill is installed. However, it won't hear "Hey Mycroft, refresh openhab items", in my case it's actually "Hey Ezra......." but I don't believe that matters.

It won't hear/action any of the .items either. e.g. "Hey Ezra, turn on Lounge Fan Light" "Hey Ezra, switch off Lounge Fan Light" "Hey Ezra, put on Lounge Fan Light"

In all of the cases Mycroft/Ezra correctly interprets my words as shown in the received text. But no actual understanding and action on their meaning.

Any assistance would be greatly appreciated.

Thanks.

Nathan

mortommy commented 6 years ago

Hi @NathanLKing , let's go trough the various steps:

NathanLKing commented 6 years ago

Hi Mortommy,

Thanks for getting back to me so quickly.

Yes, I can connect to mycroft via SSH and yes openhab is listed as a skill.

Thanks for the additional way to tell mycroft via typing. Mycroft did correctly interpret my voice.

Which log are you referring to? Where should I look to see if I can find and error?

No, as I said, Mycroft is hearing my words correctly. Mycroft responds back with it's usual excuses like "sorry, I don't understand" "I'm learning new things all the time" etc etc

The items configuration link is unfortunately quite vague. e.g. where do you actually put the examples item tagging? which file? If I try to put it in my .items file nothing works as it seems to violate the coding rules of the .items file and therefore won't read it in the openHAB system. e.g. in your link Switch KitchenLights "Kitchen Lights" (gKitchen) [ "Lighting" ]

Which is why I created ANOTHER .items file, which uses the tagging rules as stated in the HomeKit addon page - https://www.openhab.org/addons/integrations/homekit/#item-configuration

Any help would be great.

Thanks.

Nathan

mortommy commented 6 years ago

So the first problem is here:

No, as I said, Mycroft is hearing my words correctly. Mycroft responds back with it's usual excuses like "sorry, I don't understand" "I'm learning new things all the time" etc etc

Mycroft is hearing you but doesn't understand you enough to rise the use of the skill. The log I'm talking about is in the top part of mycroft-cli-client, you can see all the entries in different color (in green from skills). Does it change if you type the command 'Hey Ezra, refresh openhab items' directly via mycroft-cli-client? Did you try a standard skill, f.i. 'Hey Ezra, tell me a joke'?

NathanLKing commented 6 years ago

Yes, the standard skills work just fine. Tell me the time, joke, set a reminder, etc. Unfortunately, the same result when i type it in

NathanLKing commented 6 years ago

Ezra just says she doesn't understand

NathanLKing commented 6 years ago

and there is no change to the log shown in green and purple just that Ezra doesn't understand

NathanLKing commented 6 years ago

Ezra understand when I type or say "tell me a joke"

mortommy commented 6 years ago

Maybe a stupid question, did you configure the openHAB instance in ~/.mycroft/mycroft.conf? host address and port is needed:

"openHABSkill": {
    "host": "XXX.XXX.XXX.XXX",
    "port": "8080"
  },
NathanLKing commented 6 years ago

ah, perhaps that's not a stupid question. What might be considered stupid of me, is that I just copied and pasted, as the directions this block "openHABSkill": { "host": "openHAB server ip", "port": "openHAB server port" }

rather than changing it to the ip and port

NathanLKing commented 6 years ago

I assumed, it would incorrectly, that it gathered the info from openHAB, rather than directly

NathanLKing commented 6 years ago

ah, I rebooted with the host and port info and things have changed

Ezra is stating item not found in open hab

Hopefully that helps you to work out where I've gone wrong?

mortommy commented 6 years ago

Ok, so now Mycroft is talking to openHAB but it doesn't get any tagged item back, now it's time to look at the items definition. Could you provide an example? I didn't get why you have two different .items file (I have no experience with HomeKit).

NathanLKing commented 6 years ago

I did already share the example of the Item I don't understand why I need two different Item files either. The main point is that I cannot just edit the normal openHAB item file and add in the tagging, because it won't allow it, openHAB just won't work. You need to actually tell people how and where to add in the tagging to make it all work

NathanLKing commented 6 years ago

you stated that HomeKit is essential to connecting it all together. Is that not correct?

mortommy commented 6 years ago

No. When you have Mycroft connected to openHAB, only items tagged will seen by it. So, in your .items file (don't add items via paperUI) just add the tag to the item and that's it.

Switch KitchenLights "Kitchen Lights" (gKitchen) [ "Lighting" ]

When you say:

The main point is that I cannot just edit the normal openHAB item file and add in the tagging, because it won't allow it, openHAB just won't work.

What does it mean? Which editor are you using to edit the file?

NathanLKing commented 6 years ago

that is precisely where things go wrong

NathanLKing commented 6 years ago

I try to add in the Tagging info to the .items file and it simply won't accept it, the GUI won't work

NathanLKing commented 6 years ago

so, clearly I need to add in the Tagging some place else? where should I add this? What file? where? You need to be specific..........

NathanLKing commented 6 years ago

I'm not using the paperUI, I'm editing the file directly

mortommy commented 6 years ago

No news. Hope you got it working.