Genie Community Forum

Manually installing a skill

I am running the latest (1.99) docker version of almond-server locally on my network. Using the web ui, I tried installing the Home Assistant skill but it fails with Missing OAuth Client Secret in Authentication part of the manifest.

When I looked at the source code for this skill, I found that home assistant is currently hardcoded to const HASS_URL = 'http://hassio.local:8123'; which in my case is not correct. I am not sure whether the error above is related to this finding, but to test it out, I would like to correct the URL.

I downloaded io.home-assistant-v21.zip, unzipped it and made my modification in index.js. How & where can I deploy this inside my docker container? Can I mount it as a volume? Do I have to rebuild the container somehow?

To configure Home Assistant with Almond, you need to follow the guide in the Home Assistant documentation: https://www.home-assistant.io/integrations/almond/
Basically, you configure Almond in Home Assistant rather than the other way around. When Home Assistant starts, it connects to Almond and configures itself with the right URL and the right authentication tokens.

As for testing modifications to the skill, you can set your Almond in developer mode, which causes it to load the skill from a local directory instead of downloading from Thingpedia. To do that, you need to edit prefs.db and set developer-dir pointing to a directory containing your local skills. Each skill needs to be in a folder named after its ID in Thingpedia. That is, you set developer-dir to point to ~/MySkills, and make a directory called io.home-assistant in ~/MySkills, containing index.js and the rest of the stuff from the zip file. You also need the manifest.tt and dataset.tt files you get from https://almond-dev.stanford.edu/thingpedia/classes/by-id/io.home-assistant (or from the source at https://github.com/stanford-oval/thingpedia-common-devices/tree/master/main/io.home-assistant )

The location of prefs.db depends on how you’re running Almond. In docker, it’s in /var/lib/almond-server in the docker filesystem (which you can access with docker exec or similar). When running directly from git sources, it’s in ~/.config/almond-server
I assume you already know how to make the developer directory visible inside the docker, as you mentioned that.

Additional info is in the Thingpedia guide, in the part about testing.

It’s not clear. Can you elaborate

I’m encountering a similar problem under different circumstances. I’m running Home Assistant 2021.12.6 (latest as of today) on a Home Assistant Blue, and I’ve installed Genie-Edge as an addon. I have also successfully installed the Genie Client on a RPI3B+ and have voice commands working to my Home Assistant instance.

However, when I select “Configure a new skill” on the “My Skills” page in the add-on, the OAuth request ends up failing because the server “hassio.local” cannot be found. I’m not sure why this MDNS name is being used, because my HA instance is using “homeassistant.local”.

I would love to try creating new skills using the button in the Add-On, but for now I’m stuck at this failure. Any tips as to where “hassio.local” is originating would be welcome. :slight_smile:

Thanks!

Hello!

If you’re running the Genie add-on in Home Assistant, the Home Assistant skill is already available, and all the Home Assistant devices that are recognized will be listed in My Skills. No further configuration is necessary.

Manual configuration is only necessary when running the Genie server standalone separately from Home Assistant.

Hi - thanks for the quick response.

What if I add, rename, or delete devices? Will the skills automatically update?

Yes, Genie connects to Home Assistant and synchronizes all the recognized entities. If it doesn’t update automatically (it should), try restarting the add-on.

1 Like

I had kind of a same problem. When Almond/Genie server is installed on another server, there is 401 Unauthorised warning and HA is reporting issue in config_flows:88.

I “fixed” this problem by installing Nginx reverse proxy on the same server where Almond/Genie server is installed.

which version of Genie and HA are you running?

In our thoughts we considered as “standard” an HA server with Genie as add on (so no problem in networking), and then Genie Clients for installation in other places/systems, to be connected to main Genie (which will be then interacting locally with HA)

Otherwise you fix is the only way to do that (if the HA is the supervised, with the Core version for example, you don’t have that problem

I am running the latest version of HA that is 2022.2.2 and latest genie server built from source.

I have migrated my Core version installation to Docker over this weekend and now it is running on the same host. Interestingly enough I am experiencing new error now that Genie cannot connect back to HA, error message:

Failed to reconnect to Home Assistant: TypeError: Cannot read property ‘setSocket’ of undefined.

I am not sure if this problem is due to upgrade of HA, as before I was running 2021 December and now it is 2022 Feb. I will troubleshoot this issue later and post the results here. And error message is the same with or without Nginx proxy.

Personally, I try to avoid Supervised or OS version of HA as it is bound to hardware exclusively. I am running now HA and Genie on Nvidia Jetson Xavier NX as it is quite powerful and has small power requirements.

Update: I got it working again. I had to remove HA integration from the server and it worked fine.

1 Like