Configuration
Robert Marshall editou esta páxina %!s(int64=7) %!d(string=hai) anos

Server configuration

All settings are stored in the file HAServer.exe.config. Below is an example of such a config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <appSettings>
        <add key="mqttHost" value="localhost" />
        <add key="mqttQoS" value="2" />
        <add key="mqttRetain" value="true" />
        <add key="mqttBaseTopic" value="home" />
        <add key="webUiPort" value="8068" />
        <add key="webUiPath" value="WebUI" />
    </appSettings>
</configuration>

As you can see, the settings are stored in an appSettings section.

Here is a description of each setting:

  • mqttHost: the hostname or IP address of the MQTT server.
  • mqttQoS: what QoS level to publish with. (see here for detailed information on MQTT QoS)
    • 0: At most once
    • 1: At least once
    • 2: Exactly once.
  • mqttRetain: should the published messages be retained? true or false.
  • mqttBaseTopic: HAServer will listen to anything below this topic by appending the multilevel wildcard (/#) to the end of it. For example: home will subscribe to home/#
  • webUiPort: the port number on which the web interface will run.
  • webUiPath: the folder in which the web interface files will reside. You can set this to a new path if you wish to make your own web interface.

Apache configuration

Here are some example settings to configure a virtual host should you be running an apache site and want to access the web interface externally

ServerAlias homeautomation.example.org

ProxyPreserveHost On
ProxyRequests Off
ProxyPass /api  ws://localhost:8068/api
ProxyPassReverse /api  ws://localhost:8068/api
ProxyPass / http://localhost:8068/
ProxyPassReverse / http://localhost:8068/