start program = "/home/tortugahome/www/servers/startdaemon hue"
stop program = "/home/tortugahome/www/servers/stopdaemon hue"
-check process home-domoticz
- with pidfile "/var/run/home-domoticz.pid"
- group homeautomation
- start program = "/home/tortugahome/www/servers/startdaemon domoticz"
- stop program = "/home/tortugahome/www/servers/stopdaemon domoticz"
-
check process home-cron
with pidfile "/var/run/home-cron.pid"
group homeautomation
docker-compose pull
docker-compose down
docker-compose up -d
-#docker exec -it tortugahome /application/bin/restarthome
docker restart nginx-proxy
</component>
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change beforePath="$PROJECT_DIR$/.idea/dataSources.local.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.local.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/.docker/config/monit/conf.d/home" beforeDir="false" afterPath="$PROJECT_DIR$/.docker/config/monit/conf.d/home" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/.docker/update" beforeDir="false" afterPath="$PROJECT_DIR$/.docker/update" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/scripts/lib/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/bin/healthcheck" beforeDir="false" afterPath="$PROJECT_DIR$/bin/healthcheck" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/bin/restart-logcat" beforeDir="false" afterPath="$PROJECT_DIR$/bin/restart-logcat" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/bin/restarthome" beforeDir="false" afterPath="$PROJECT_DIR$/bin/restarthome" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/servers/domoticz.php" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/servers/hue.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/hue.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/servers/insteon.php" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/servers/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/servers/squeezebox.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1707238767637" duration="1470000" />
<workItem from="1707311861067" duration="5052000" />
<workItem from="1707323806669" duration="1110000" />
- <workItem from="1708089220716" duration="1009000" />
+ <workItem from="1708089220716" duration="1619000" />
+ <workItem from="1708442844514" duration="418000" />
+ <workItem from="1709114228146" duration="2209000" />
</task>
<task id="LOCAL-00502" summary=".">
<created>1641726946298</created>
<option name="project" value="LOCAL" />
<updated>1687259667913</updated>
</task>
- <option name="localTasksCounter" value="607" />
+ <option name="localTasksCounter" value="608" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<?php
require_once __DIR__ . "/../scripts/import.php";
$heartbeats = ['cron', /*'logcats', 'logcatb',*/
- 'domoticz', 'hue', 'squeezebox'];
+ 'hue', 'squeezebox'];
$hasError = false;
$mintime = INF;
#!/bin/sh
+pkill -f adb
/application/bin/adb-connect
/application/servers/stopdaemon logcats
/application/servers/stopdaemon logcatb
sleep 1
service atd restart
sleep 3
-/application/servers/stopdaemon domoticz
-/application/servers/startdaemon domoticz
/application/servers/stopdaemon cron
/application/servers/startdaemon cron
/application/servers/stopdaemon hue
setState('guest', hasGuest() ? '1' : '0');
}
-function cronInsteon($cronmin) {
- _logSection('Insteon');
- insteonCommand('knock');
-}
-
function cronEcoMode($cronmin) {
_logSection('Ecomode');
+ setState('cron_heartbeat', time());
ecoMode(null, $cronmin % 15 === 0);
}
+++ /dev/null
-#!/usr/bin/php
-
-<?php
-
-
-require_once __DIR__ . "/../scripts/import.php";
-
-// Set time limit to indefinite execution
-set_time_limit(0);
-ignore_user_abort(true);
-
-echo 'Run home server domoticz' . "\n";
-
-$redis = connectRedis();
-redisEventListener('domoticz_event', 'handleDomoticzQueue');
-handleDomoticzQueue();
-
-function handleDomoticzQueue()
-{
- global $redis;
-
- while (true) {
- setState('domoticz_heartbeat', time());
- $q = 'domoticz_queue';
- $queue = $redis->igbget($q);
- if (!is_array($queue)) {
- $queue = [];
- $redis->igbset($q, $queue);
- }
- if (!count($queue)) {
- echo 'End processing queue' . "\n";
- break;
- }
-
- $command = array_shift($queue);
- $redis->igbset($q, $queue);
- echo 'Run command ' . json_encode($command) . "\n";
- runDomoticzCommand($command);
- usleep(1000000 * 0.25);
- }
-}
\ No newline at end of file
echo 'Run hue server hue' . "\n";
$redis = connectRedis();
-handleHueQueue();
-
redisEventListener('hue_event', 'handleHueQueue');
+handleHueQueue(true);
-function handleHueQueue()
+function handleHueQueue($init = false)
{
global $redis;
if (!count($queue)) {
echo 'Queue empty ' . "\n";
+ if ($init) {
+ sleep(30);
+ continue;
+ }
break;
}
echo 'Run command ' . json_encode($command) . "\n";
try {
_hueCommand($command);
- }catch (Exception $e){
+ } catch (Exception $e) {
}
usleep(1000000 * 0.1);
+++ /dev/null
-#!/usr/bin/php
-
-<?php
-require_once __DIR__ . "/../scripts/import.php";
-
-// Set time limit to indefinite execution
-set_time_limit(0);
-ignore_user_abort(true);
-
-echo 'Run home server insteon' . "\n";
-
-$redis = connectRedis();
-handleInsteonQueue();
-
-redisEventListener('insteon_event', 'handleInsteonQueue');
-
-function handleInsteonQueue()
-{
- global $redis;
-
- while (true) {
- $queue = $redis->igbget('insteon_queue');
- if (!is_array($queue)) {
- $queue = [];
- $redis->igbset('insteon_queue', $queue);
- }
-
-
- if (!count($queue)) {
- echo 'Queue empty ' . "\n";
- break;
- }
-
- $queue = array_unique($queue);
-
- echo 'Handle Queue : current state ' . json_encode($queue) . "\n";
-
- $command = array_shift($queue);
- $redis->igbset('insteon_queue', $queue);
- echo 'Run command ' . $command . "\n";
- if ($command == 'knock') {
- insteonKnock();
- continue;
- }
- runInsteonCommand($command);
- usleep(1000000 * 0.5);
- }
- echo 'End of handling queue' . "\n";
-}
\ No newline at end of file
$redis = connectRedis();
redisEventListener('squeezebox_event', 'handleSqueezeboxQueue');
-handleSqueezeboxQueue();
+handleSqueezeboxQueue(true);
-function handleSqueezeboxQueue()
+function handleSqueezeboxQueue($init = false)
{
global $redis, $processingSqueezeboxQueue;
}
if (!count($queue)) {
echo 'End processing queue :)' . "\n";
+ if ($init) {
+ sleep(30);
+ continue;
+ }
$processingSqueezeboxQueue = false;
break;
}