Home Assistant Kodi Addon (HAKA!)

HAKA!

This is a Home Assistant Kodi Addon (HAKA!).

Prerequisites

  • Home Assistant 2021.2.1 or higher (older versions have a different API)
  • Kodi 18 or Kodi 19

Installation

  1. Download the zip file from Github (Kodi 18 / Kodi 19)

  2. In Home Assistant navigate to your profile (bottom icon in the side-menu).

  3. Scroll down and generate a long life token (long live the tokens!).

  4. Write down the token / carve it in a stone / memorize / use a carrier pigeon and send it to yourself or… just copy the token.

  5. Launch Kodi >> Add-ons >> Get More >> … >> Install from zip file

  6. Enter your Home Assistant IP and port (i.e. https://myfancypansyhainstallation.duckdns.org:8123)

  7. Enter the token obtained in step four (don’t forget to release the pigeon if you used one)

  8. Set up the domains you would like to browse from your couch.

Enjoy!

Features

The following domains are supported:

  • Automations (toggle)
  • Camera (view)
  • Climate (toggle)
  • Fan (toggle)
  • Group (toggle)
  • Light (toggle)
  • Persons (no action)
  • Scene (turn on)
  • Script (turn on)
  • Sensor (no action)
  • Switch (toggle)
  • Vacuum (start, stop, return to base, locate)

HAKA! Favorites

Add home assistant entities in a favorites folder which can be added to Kodi main menu in form of tiles, widget or whatever you want to name them. See the example of HAKA! favorites when using the Embuary skin below.

Change log

Version 1.2.0 (2021-10-13)

  • Camera support (view picture of HA camera’s)
  • Fan support (toggle)
  • Fixed issue: Crash when friendly name is not available

Version 1.1.0 (2021-02-21)

  • Kodi Matrix support
  • HAKA! Favorites section added (add items via context menu)
  • Extra sensor icons and sensor attributes as label
  • Persons domain added
  • Navigate to settings from within addon menu
  • Sort items by friendly name by default
  • Fixed issue: Items in Kodi main menu keep refreshing
  • Fixed issue: Not ascii characters give errors when generating label

Version 1.0.1 (2020-10-23)

  • Debug logging added

Version 1.0.0 (2020-10-22)

  • First release!
3 Likes

i keep getting unknown error: check ip address or if server is online.

kodi 18.8
libreelec 9.2.4
raspberry pi 3

Whats the format of your IP address? It should include https:// or http:// and the port number.

its https://domain.com:8123
also tried https://ipaddres:8123
and tried both without https

Can you pastebin the last part of your Kodi.log file?

Hi
Can you explain a little what the addon can do? (1-2 exmples)
I don’t have kodi right now but I can install it.
I am a little confused for the possibilities of this addon.
Thanks

2020-10-22 14:20:12.146 T:1305465728  NOTICE: LoadJpeg: unable to load /storage/.kodi/addons/script.program.homassistant/fanart.jpg
2020-10-22 14:21:28.628 T:1937514512  NOTICE: Samba is idle. Closing the remaining connections
2020-10-22 14:23:58.647 T:1208214400   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'text'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/script.program.homassistant/addon.py", line 242, in <module>
                                                browseByDomain()
                                              File "/storage/.kodi/addons/script.program.homassistant/addon.py", line 130, in browseByDomain
                                                parsedResponse = json.loads(response.text)
                                            AttributeError: 'NoneType' object has no attribute 'text'
                                            -->End of Python script error report<--
2020-10-22 14:23:58.993 T:1305465728   ERROR: GetDirectory - Error getting plugin://script.program.homassistant/
2020-10-22 14:23:58.996 T:1937514512   ERROR: CGUIMediaWindow::GetDirectory(plugin://script.program.homassistant/) failed
2020-10-22 14:24:36.663 T:1090511744   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'text'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/script.program.homassistant/addon.py", line 242, in <module>
                                                browseByDomain()
                                              File "/storage/.kodi/addons/script.program.homassistant/addon.py", line 130, in browseByDomain
                                                parsedResponse = json.loads(response.text)
                                            AttributeError: 'NoneType' object has no attribute 'text'
                                            -->End of Python script error report<--
2020-10-22 14:24:37.028 T:1492878208   ERROR: GetDirectory - Error getting plugin://script.program.homassistant/
2020-10-22 14:24:37.028 T:1937514512   ERROR: CGUIMediaWindow::GetDirectory(plugin://script.program.homassistant/) failed
2020-10-22 14:25:33.551 T:1090511744   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'text'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/script.program.homassistant/addon.py", line 242, in <module>
                                                browseByDomain()
                                              File "/storage/.kodi/addons/script.program.homassistant/addon.py", line 130, in browseByDomain
                                                parsedResponse = json.loads(response.text)
                                            AttributeError: 'NoneType' object has no attribute 'text'
                                            -->End of Python script error report<--
2020-10-22 14:25:33.918 T:1305465728   ERROR: GetDirectory - Error getting plugin://script.program.homassistant/
2020-10-22 14:25:33.918 T:1937514512   ERROR: CGUIMediaWindow::GetDirectory(plugin://script.program.homassistant/) failed
2020-10-22 14:26:38.647 T:1313858432   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'text'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/script.program.homassistant/addon.py", line 242, in <module>
                                                browseByDomain()
                                              File "/storage/.kodi/addons/script.program.homassistant/addon.py", line 130, in browseByDomain
                                                parsedResponse = json.loads(response.text)
                                            AttributeError: 'NoneType' object has no attribute 'text'
                                            -->End of Python script error report<--
2020-10-22 14:26:38.980 T:1492878208   ERROR: GetDirectory - Error getting plugin://script.program.homassistant/
2020-10-22 14:26:38.980 T:1937514512   ERROR: CGUIMediaWindow::GetDirectory(plugin://script.program.homassistant/) failed
2020-10-22 14:27:41.865 T:1937514512  NOTICE: Quitting due to POSIX signal
2020-10-22 14:27:41.899 T:1937514512  NOTICE: Stopping player

Can you explain a little what the addon can do? (1-2 exmples)

Its just a simple addon that will put all your entities in a list. “Playing” the kodi item will toggle your entity.

so we can handle the above domains of HA from kodi. Very nice. Thanks!

I will add some more logging in the next version to help you out.

Well, I was able to install and get this running way faster than I expected, nice work

1 Like

I wwill also need to post some error logs… apparently i sucessfully connected to home assistant as it shows me the version. latest beta 117 b2 but get error … let me check logs and revert

for the moemnt light, sensr and vacuum seems not working

I created a dev branch that will give a bit more logging. You can enable it in the settings.

just need to figure out how to get those logs then :stuck_out_tongue:

   \\kodiipaddress\Logfiles

K thanks Will have a look into it tonight :slight_smile:

I would just like to verify this is still working with before I proceed.

Yes, its still working. Tested on Kodi 18.9 and HA 2021.1

Just uploaded version 1.1.0 with the following changes.

  • HAKA! Favorites section added (add items via context menu)
  • Extra sensor icons and sensor attributes as label
  • Persons domain added
  • Navigate to settings from within addon menu
  • Sort items by friendly name by default
  • Fixed issue: Items in Kodi main menu keep refreshing
  • Fixed issue: Not ascii characters give errors when generating label

Biggest one in my view is to add items to a favourites folder which you can place on the main screen of Kodi (see my first post).

Feel free to drop any bugs, suggestions and / or comments…

The Kodi Matrix version is added to the official Kodi addon repository for easier installation from within Kodi