AppDeamon 4 and ControllerX - slamkalukas/hassio-smart-home GitHub Wiki
This tutorial will show you how to install:
- ControllerX https://github.com/xaviml/controllerx
- AppDeamon4 https://github.com/hassio-addons/addon-appdaemon
Prerequisites:
- Hassio running 0.107
- Zigbee integration (i am using Conbee2)
- HACS installed and running
- One IKEA button and any light
If there are any values needed, they are marked as CHANGE_ME and examples are in "" in parenthesis after changed value. Please delete also my comment and leave only your value.
Step 1 - installation of AppDeamon 4
Open hassio and go to Supervisor -> Add-on store (yourIp:8123/hassio/store). Search for AppDaemon 4, it is part of community addons. If you don't have this repository, add it via top menu with link https://addons.community. Don't change any config, just start it.
Step 2 - configuration of AppDeamon 4
Open File editor. In your /config/ folder you got a new folder with name appdeamon. Inside this folder create a new file appdaemon.yaml. The addess for this file will be /config/appdaemon/appdaemon.yaml Put this inside your appdeamon.yaml
appdaemon:
plugins:
HASS:
type: hass
token: CHANGE_ME (loooong token)
ha_url: CHANGE_ME (your HA url with port - example: "http://10.40.50.6:8123")
production_mode: True
time_zone: CHANGE_ME (your timezone - "Europe/Bratislava")
latitude: CHANGE_ME (your latitude; use google maps if you dont know - "48.3025665")
longitude: CHANGE_ME ("18.0808754")
elevation: CHANGE_ME ("120.0")
http:
url: CHANGE_ME (keep the port and edit the url only - "http://10.40.50.6:5050")
api:
admin:
Step 3 - Token creation & geo info
To create a unique token, open http://yourIP:8123/profile . In the bottom of the page you will find a section where you can create long-term tokens. Give it a unique name and submit it - your token will be shown this time only, so copy it and keep it secure!!!
Geo info: use maps.google.com to get it - just search for your city and check the URL, long and lat values are shown there. Elevation value you can get from your city webpage/Wikipedia.
Go back to File editor and change all CHANGE_ME values. You should have all the informations. After filling all the values, go back to Supervisor -> Add-on store and restart AppDeamon 4. Check logs and after few seconds you should see:
2020-03-22 17:59:38.087192 INFO AppDaemon: App initialization complete
Step 4 - Install ControllerX
Open HACS and install ControllerX. After installation go to File editor and go to /config/appdaemon/apps and create apps.yaml file (the whole path will be /config/appdaemon/apps/apps.yaml)
Content of sample integration:
CHANGE_ME: (name of your controller - "living_room_controler"):
module: controllerx
class: CHANGE_ME (class name of your controller - choose from the list https://xaviml.github.io/controllerx/controllers/ - "E1743Controller")
controller: CHANGE_ME (entity id of button - how to get this id is described here [https://xaviml.github.io/controllerx/others/extract-controller-id](https://xaviml.github.io/controllerx/others/extract-controller-id))
integration: CHANGE_ME (depending on how you are connecting your button; options are <z2m | deconz | zha> - "deconz" )
light: CHANGE_ME (your light entity id - "light.lampa_lukas")
mapping: (based on events from button + functions which i want - the whole list is available [https://xaviml.github.io/controllerx/others/custom-controllers](https://xaviml.github.io/controllerx/others/custom-controllers))
1002: on
2002: off
1001: hold_brightness_up
2001: hold_brightness_down
1003: release
2003: release
Step 5 - Final restart
Open hassio and go to Supervisor -> In the Add-ons section you should see AppDeamon 4, please open it and restart it once more. After successful restart you should see:
2020-03-22 17:59:37.717290 INFO AppDaemon: Initializing app living_room_controller using class E1743Controller from module controllerx
2020-03-22 17:59:38.068740 INFO living_room_: ControllerX v2.4.3
2020-03-22 17:59:38.087192 INFO AppDaemon: App initialization complete
This is final step, you should be able to control your lights with help of ControllerX! Enjoy!