-
Notifications
You must be signed in to change notification settings - Fork 8
Install NimHA
NimHA is developed in Nim-lang. Nim is a systems and applications programming language. Statically typed and compiled and it provides unparalleled performance.
- nim >= 0.18.1
- (nim) bcrypt >= 0.2.1
- (nim) jester >= 0.4.0
- (nim) multicast >= 0.1.1
- (nim) recaptcha >= 1.0.2
- (nim) websocket >= 0.3.1
The requirements below are used within NimHA until they can be replaced with pure Nim. Make sure they are installed on your system.
- curl (Pushbullet)
- mosquitto (nearly all modules)
- openssl (ssl)
- python3 (encrypting token for Xiaomi)
- pycrypto (encrypting token for Xiaomi)
The official instructions can be found here https://nim-lang.org/install.html
Installing with choosenim is very easy. Just run:
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
choosenim devel
Choosenim does currently (2018 August) not support amd. You need to follow the instructions on https://github.com/nim-lang/Nim#compiling. After compiling Nim symlink your executable:
ln -sf /the/path/to/nim/git/Nim/bin/nim /usr/bin/nim
ln -sf /the/path/to/nim/git/Nim/bin/nimble /usr/bin/nimble
The Nim packages can all be installed with Nimble.
Run the following commands:
nimble install bcrypt
nimble install jester
nimble install multicast
nimble install recaptcha
nimble install websocket
NimHA can be installed in 2 ways - through Nimble or you can compile it.
Run:
nimble install nimha
Available compile options are shown below
Run:
cd
git clone https://github.com/ThomasTJdev/nim_homeassistant.git
cd nim_homeassistant
nim c nimha.nim
When you are compiling NimHA, you have access to the following compile options. Append the parameters to nim c nimha.nim
.
-
-d:dev
= Run development/debug mode -
-d:devmailon
= Allow sending mails in dev mode -
-d:logoutput
= Enhanced logging -
-d:rc
= Recompile all modules. NimHA will not recompile modules without this if the modules exists. To recompile a single module use the options below. -
-d:rcwss
= Recompile Websocket -
-d:rccron
= Recompile Cron -
-d:rcwebinterface
= Recompile Webinterface -
-d:rcgatewaywss
= Recompile Websocket gateway -
-d:rcgateway
= Recompile Main gateway -
-d:rcxlistener
= Recompile Xiaomi listener
Your config file (secret.cfg
) are located in the config
-folder.
Copy the template before editing:
cp config/secret_default.cfg config/secret.cfg
It is required that the following details are updated:
- [MQTT]
- [Websocket] - only needs update if you are using Nginx/SSL
To get access to NimHA, you need to add an admin user. Only 1 admin user is allowed.
Run NimHA with following arguments:
./nimha newuser -u:username -p:password -e:my@email.com
Make sure that your MQTT broker is up and running, e.g. sudo systemctl start mosquitto
.
Run NimHA from file:
./nimha
Run NimHA after compile:
nim c -r nimha.nim
- Home
- Requirements
- Install NimHA
- Optional
- Modules
- Tutorials (helpers, etc.)
- Development