Initial setup of mycontroller

This commit is contained in:
2019-11-28 09:16:11 -06:00
parent 62d71e30c1
commit 665eb783be
504 changed files with 212034 additions and 0 deletions

BIN
conf/keystore.jks Normal file

Binary file not shown.

125
conf/logback.xml Normal file
View File

@@ -0,0 +1,125 @@
<!--
Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com)
and other contributors as indicated by the @author tags.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration scan="true" scanPeriod="2 minutes">
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>../logs/mycontroller.log</file>
<encoder>
<!-- <pattern>%date %level [%thread] [%logger:%line] %msg%n</pattern> -->
<!-- Replace CR(\r) with string \r and LF(\n) with string \n-->
<pattern>%date %level [%thread] [%logger:%line] %replace(%msg){'\r', '\\r'}%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>../logs/mycontroller_%i.log.zip</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>5</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>5MB</MaxFileSize>
</triggeringPolicy>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date %level [%thread] [%logger:%line] %msg%n</pattern>
</encoder>
</appender>
<appender name="GATEWAY_RAW_MESSAGE_APPENDER" class="ch.qos.logback.classic.sift.SiftingAppender">
<discriminator>
<key>gateway_reference</key>
<defaultValue>0_default</defaultValue>
</discriminator>
<sift>
<appender name="fileAppender" class="ch.qos.logback.core.FileAppender">
<file>../logs/raw_message_gw_${gateway_reference}.log</file>
<encoder>
<pattern>%date %replace(%replace(%msg){'\r', '\\r'}){'\n', '\\n'}%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>../logs/raw_message_gw_${gateway_reference}%i.log.zip</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>5</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>5MB</MaxFileSize>
</triggeringPolicy>
</appender>
</sift>
</appender>
<logger level="INFO" name="com.j256.ormlite" />
<logger level="INFO" name="org.apache.http" />
<logger level="INFO" name="org.jboss.resteasy.core" />
<logger level="WARN" name="com.j256.ormlite.table.TableUtils" />
<logger level="WARN" name="com.xeiam.sundial" />
<logger level="WARN" name="org.quartz" />
<logger level="WARN" name="io.moquette"/>
<logger level="ERROR" name="io.moquette.persistence.mapdb.MapDBSessionsStore"/>
<logger level="ERROR" name="io.moquette.spi.impl.PersistentQueueMessageSender"/>
<logger level="INFO" name="org.mycontroller.standalone" />
<logger level="INFO" name="org.mycontroller.standalone.api" />
<logger level="INFO" name="org.mycontroller.standalone.api.jaxrs" />
<logger level="INFO" name="org.mycontroller.standalone.auth" />
<logger level="INFO" name="org.mycontroller.standalone.backup" />
<logger level="INFO" name="org.mycontroller.standalone.db" />
<logger level="INFO" name="org.mycontroller.standalone.db.dao" />
<logger level="INFO" name="org.mycontroller.standalone.db.migration" />
<logger level="INFO" name="org.mycontroller.standalone.email" />
<logger level="INFO" name="org.mycontroller.standalone.fwpayload" />
<logger level="INFO" name="org.mycontroller.standalone.gateway" />
<logger level="INFO" name="org.mycontroller.standalone.gateway.ethernet" />
<logger level="INFO" name="org.mycontroller.standalone.gateway.mqtt" />
<logger level="INFO" name="org.mycontroller.standalone.gateway.phantio" />
<logger level="INFO" name="org.mycontroller.standalone.gateway.philipshue" />
<logger level="INFO" name="org.mycontroller.standalone.gateway.rest" />
<logger level="INFO" name="org.mycontroller.standalone.gateway.serial" />
<logger level="INFO" name="org.mycontroller.standalone.gateway.wunderground" />
<logger level="INFO" name="org.mycontroller.standalone.group" />
<logger level="INFO" name="org.mycontroller.standalone.jobs" />
<logger level="INFO" name="org.mycontroller.standalone.loggers.LoggerMySql" />
<logger level="INFO" name="org.mycontroller.standalone.message" />
<logger level="INFO" name="org.mycontroller.standalone.metric" />
<logger level="INFO" name="org.mycontroller.standalone.metric.jobs" />
<logger level="INFO" name="org.mycontroller.standalone.mqttbroker" />
<logger level="INFO" name="org.mycontroller.standalone.provider" />
<logger level="INFO" name="org.mycontroller.standalone.provider.mycontroller" />
<logger level="INFO" name="org.mycontroller.standalone.provider.mysensors" />
<logger level="INFO" name="org.mycontroller.standalone.provider.phantio" />
<logger level="INFO" name="org.mycontroller.standalone.provider.philipshue" />
<logger level="INFO" name="org.mycontroller.standalone.provider.rflink" />
<logger level="INFO" name="org.mycontroller.standalone.provider.wunderground" />
<logger level="INFO" name="org.mycontroller.standalone.restclient" />
<logger level="INFO" name="org.mycontroller.standalone.rule" />
<logger level="INFO" name="org.mycontroller.standalone.scheduler" />
<logger level="INFO" name="org.mycontroller.standalone.scripts" />
<logger level="INFO" name="org.mycontroller.standalone.settings" />
<logger level="INFO" name="org.mycontroller.standalone.timer" />
<logger level="INFO" name="org.mycontroller.standalone.uidtag" />
<root level="WARN">
<appender-ref ref="FILE" />
</root>
<logger name="RAW_MESSAGE_LOGGER" level="INFO" additivity="false">
<appender-ref ref="GATEWAY_RAW_MESSAGE_APPENDER" />
</logger>
</configuration>

BIN
conf/mycontroller.mv.db Normal file

Binary file not shown.

View File

@@ -0,0 +1,134 @@
#
# Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com)
# and other contributors as indicated by the @author tags.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#========================================================================
# Mycontroller.org properties
# If you change any settings in this file,
# Mycontroller.org server restart is required, to apply new configuration
#========================================================================
#=========================================================================================================
# Data Processing Agreement
# -------------------------
# By using this software you agree that the following non-PII (non personally identifiable information)
# data will be collected, processed and used by MyController.org for the purpose of improving quality of
# MyController software.
# If you do not like to share setup anonymous data, disable it here, by setting false
# restart the server and logout and login in the UI
#=========================================================================================================
mcc.collect.anonymous.data=true
#========================================================================
# Application temporary location
#========================================================================
mcc.tmp.location=tmp/
#========================================================================
# Resources location
#========================================================================
mcc.resources.location=../conf/resources/
#========================================================================
# Database settings
# It is highly recommended to take a backup of this db on upgrade.
# MyController only supports database backup for H2DB(only on same host)
# For other databases users has to manage backup and restore of database
# mcc.db.backup.include: Include database backup along with
# MyController backup. Supports only for H2DB on same host.
# If MyController is running on embedded database mode, this parameter
# will be ignored and backup includes database also.
# mcc.db.type: Select database types
# Supported types: H2DB_EMBEDDED, H2DB, MYSQL, POSTGRESQL, MARIADB
#========================================================================
mcc.db.backup.include=true
#H2DB Embedded settings
mcc.db.type=H2DB_EMBEDDED
mcc.db.url=jdbc:h2:file:../conf/mycontroller;MVCC=TRUE
mcc.db.username=mycontroller
mcc.db.password=mycontroller
# H2DB on TCP settings - Sample
#mcc.db.type=H2DB
#mcc.db.url=jdbc:h2:tcp://localhost//tmp/mycontroller;MVCC=TRUE
#mcc.db.username=mycontroller
#mcc.db.password=mycontroller
# MariaDB settings - Sample
#mcc.db.type=MARIADB
#mcc.db.url=jdbc:mariadb://127.0.0.1:3306/mycontroller
#mcc.db.username=mycontroller
#mcc.db.password=mycontroller
# PostgreSQL settings - Sample
#mcc.db.type=POSTGRESQL
#mcc.db.url=jdbc:postgresql://localhost:5432/mycontroller
#mcc.db.username=mycontroller
#mcc.db.password=mycontroller
# MySQL settings - Sample
#mcc.db.type=MYSQL
#mcc.db.url=jdbc:mysql://localhost:3306/mycontroller
#mcc.db.username=mycontroller
#mcc.db.password=mycontroller
#========================================================================
# Web Application server configuration
# bind.address - interface to bind. 0.0.0.0 - all available interfaces
# You can use either http or https, enable.https - https is enabled
# if https is enabled specify keystore file details
# It is highly recommended to use https also change default keystore file
# Web files, will be located under ../www by default
# For web used angularjs
#========================================================================
mcc.web.bind.address=0.0.0.0
mcc.web.enable.https=true
mcc.web.http.port=8443
mcc.web.file.location=../www/
mcc.web.ssl.keystore.file=../conf/keystore.jks
mcc.web.ssl.keystore.password=mycontroller
mcc.web.ssl.keystore.type=JKS
#========================================================================
# ** MQTT broker configuration **
# broker.enabled - Enable/Disable MQTT broker from back-end
# ** Other settings are available on the GUI **
# ** If MQTT broker disabled here. Cannot enable it from GUI. **
#========================================================================
mcc.mqtt.broker.enabled=true
#========================================================================
# MyController persistent stores location.
# This store used to keep off-heap data.
# It keeps data like messages queue, MQTT broker data, etc.
# If you want to keep execute old data that not processed on shutdown
# set false on mcc.clear.message.queue.on.start
# If you want to keep smart sleep messages on MyController reboot,
# set false on mcc.clear.smart.sleep.msg.queue.on.start
#========================================================================
mcc.persistent.stores.location=../conf/persistent_stores/
mcc.clear.message.queue.on.start=true
mcc.clear.smart.sleep.msg.queue.on.start=true
#========================================================================
# MyController mDNS service settings
# Enable or disable mDNS service
#========================================================================
mcc.mdns.service.enable=false
#logger configuration - logback.xml

2068
conf/mycontroller.trace.db Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
"[{\"columns\":[{\"styleClass\":\"col-md-4\",\"widgets\":[{\"type\":\"mycTime\",\"config\":{\"datePattern\":\"MMM dd, yyyy\",\"refreshTime\":\"120\"},\"title\":\"MyController time\",\"titleTemplateUrl\":\"../src/templates/widget-title.html\",\"wid\":\"1454676806001-1\"},{\"type\":\"mycSunriseTime\",\"config\":{\"refreshTime\":\"300\"},\"title\":\"Sunrise and sunset time\",\"titleTemplateUrl\":\"../src/templates/widget-title.html\",\"wid\":\"1454685464871-1\"}],\"cid\":\"1574885484919-2\"},{\"styleClass\":\"col-md-4\",\"widgets\":[{\"type\":\"mycSenVars\",\"config\":{\"variableIds\":[\"3\",\"4\"],\"showIcon\":true,\"confirmationEnabled\":false,\"itemsPerRow\":\"2\",\"refreshTime\":30},\"title\":\"Garage Doors\",\"titleTemplateUrl\":\"../src/templates/widget-title.html\",\"wid\":\"1574885450524-1\"}],\"cid\":\"1574885484920-3\"},{\"styleClass\":\"col-md-4\",\"widgets\":[],\"cid\":\"1574885484921-4\"}]},{\"columns\":[{\"styleClass\":\"col-md-12\",\"widgets\":[],\"cid\":\"1574885484922-5\"}]}]"

View File

@@ -0,0 +1,4 @@
northDoorOpen = mcApi.uidTag().getByUid("north-garage-door-tripped").getResource();
southDoorOpen = mcApi.uidTag().getByUid("south-garage-door-tripped").getResource();
!northDoorOpen || !southDoorOpen

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<style>body {font-size: 12px;}</style>
<body>
<b>Dear User,</b>
<br>
<br>There is a rule triggered for you!
<br>
<br>
<table border='0'>
<tr><td>Rule definition name</td><td>: ${notification.ruleName}</td> <tr>
<tr><td>Condition</td><td>: ${notification.ruleCondition}</td><tr>
<tr><td>Actual value</td><td>: ${notification.actualValue}</td><tr>
<tr><td>Triggered at</td><td>: ${notification.triggeredAt}</td><tr>
</table>
<br>
<br>-- Powered by <a href='http://www.MyController.org'>www.MyController.org</a>
</body>
</html>