Louis XIV is a small-ish application to help you with automating various actions based on a SolarLog-monitored solar power plant.
It integrates with IFTTT via its Maker
channel, with
planned support for other services.
-
Start by defining those SolarLog stations which you would like to monitor. For that, you simply need to know the URL of their HTTP interface.
-
Hook up IFTTT by defining your Maker key, as well as those events which you would like to send.
-
Create
Maker Actions
by combining Maker keys and Maker events. -
Define triggers, which fire when certain conditions of connected stations are fulfilled, and define which actions they should execute.
Following env variables can be set to configure Louis XIV.
Rack environment which to use. Influences logging level, whether stacktraces are shown, etc. Supported options:
production
testing
development
Note: Strictly speaking, RACK_ENV influences Rack's setup. However, Padrino (and other tools) derive their default environment from it.
Dealing with timezones can be rather frustrating, as the options available vary depending on the database adapter.
With some adapters, you are able to use named timezones for the settings below
- these are timezones like
Europe/London
orEST
. With others you are limited to two options -local
to use the server's local time, andutc
to use UTC.
Mind the capitalization! UTC
will use the
named-timezone for UTC, whereas utc
will use the basic-behaviour UTC.
TIMEZONE_DATABASE
= UTCTIMEZONE_APPLICATION
=Your/Local/Timezone
- Do not set
TZ
TIMEZONE_DATABASE
= utcTIMEZONE_APPLICATION
= localTZ
=Your/Local/Timezone
This works (in my tests) well, at the cost of modifying the container's timezone.
Default: utc
Timezone which timestamps will be converted to when loaded from the database. This is essentially the timezone you will see in the application's frontend.
It is advisable to set this to your local timezone - e.g. Europe/London
.
Default: TIMEZONE_APPLICATION
Timezone which unmarked timestamps will be assumed to be in. This might be the case for user-input times.
It is advisable to use the same value as for TIMEZONE_APPLICATION
in order
not to lead to unexpected results - the default value will do just that.
Default: utc
Timezone which to use for storing timestamps in the database. Also defines which timezone timestamps stored in the database are assumed to be in, unless they specify otherwise.
Do not change this value, unless you are certain of what you are doing.
Default: sqlite
Define which DB adapter to use. Supported options:
mysql2
for MySQLpostgres
for Postgressqlite
for SQLite
Hostname or IP address where the database server is at. Ignored for SQLite databases.
Default: db/louis_xiv_$ENV.db
Name of the database which to use. Must exist already.
For SQLite, specify the path of the database file.
The default value is only suitable for dev environments, not for production use
Database user with which to authenticate. Ignored for SQLite databases.
Password of the database user with which to authenticate. Ignored for SQLite databases.
Default: localhost
Hostname or IP address where the Redis server is at.
Default: 6379
Port of the Redis server.
Optional URL where the Resque web-UI will be mounted. If undefined, UI will not be mounted.
Required
Queues which the Resque worker will pull tasks from.
Use *
to make it pull tasks from all queues.
Library-default: 5
Interval at which Resque workers pull for tasks, in seconds.
Library-default: 5
Interval at which Resque's Scheduler checks whether there's tasks to be schedule or executed.
Default: 8080
TCP port which unicorn will bind to.
Default: 2
Number of unicorn workers which to spawn.
In case of CPU-bound applications, this should be >= the number of the CPU cores you have. If you are bound by memory, use as many as you can support.
If you have occasional slow jobs which are not CPU-bound, increasing it above the number of CPU cores can be a good idea.
Note: Normally, unicorn can be told to increase/decrease the number of workers by sending it a TTIN/TTOU signal. However, those are not relayed by Tini, which means you must send the signal to the unicorn master directly, and can not send it to the container.