This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| mydir="$(dirname "$(readlink -f "$0")")" | |
| php ${mydir}/craft backup --interactive=0 | |
| backupfile="$(ls -Art "${mydir}/storage/backups/" | tail -n 1)" | |
| now=`date +"%Y-%m-%d"` | |
| tar cvzf ${mydir}/storage/runtime/temp/backup-${now}.tar.gz ${mydir}/storage/backups/${backupfile} ${mydir}/web/uploads/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // при перемиканні ioncs8_config в ON конфігуруємо реле | |
| rules.JSRule({ | |
| name: "Initial relay config", | |
| triggers: [triggers.ItemCommandTrigger('ioncs8_config')], | |
| execute: (event) => { | |
| // відв'язуємо перший та восьмий вхід від виходу | |
| if (event.receivedCommand === 'ON') items.getItem('ioncs8_1_configuration_outputmapping').sendCommand(0b01111110); | |
| else items.getItem('ioncs8_1_configuration_outputmapping').sendCommand(0b11111111); | |
| console.log('RELAY CONFIGURED'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Group ioncs8 "ION CS8" ["Equipment", "Light"] | |
| Switch ioncs8_config "Налаштувати реле :)" (ioncs8) | |
| Switch ioncs8_1_relay "1" (ioncs8) {channel="modbus:data:ion8cs_1:output:i1:switch"} | |
| Contact ioncs8_1_status1 "1" (ioncs8) {channel="modbus:data:ion8cs_1:input:status1:contact"} | |
| Contact ioncs8_1_status8 "8" (ioncs8) {channel="modbus:data:ion8cs_1:input:status8:contact"} | |
| Group ioncs8_1_configuration "ION CS8 settings" (ioncs8) | |
| Number ioncs8_1_configuration_outputmapping (ioncs8_1_configuration) {channel="modbus:data:ion8cs_1:outputs:mapping:number"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // донгл /dev/usbModbus на швидкості 9600 з'єднано із реле slave=7 | |
| Bridge modbus:serial:ion8cs_1 [ port="/dev/usbModbus", id=7, baud=9600, stopBits="2.0", parity="none",dataBits=8, encoding="rtu"] { | |
| // 8 coil регістрів починаючи з 0, це керування станом реле | |
| // я не знайшов це в документації і якось здогадався шо воно може бути саме так | |
| Bridge poller output [ start=0, length=8, type="coil" ] { | |
| Thing data i1 "Стан 1" [ readStart="0", readValueType="bit", writeStart="0", writeType="coil"] | |
| Thing data i2 "Стан 2" [ readStart="1", readValueType="bit", writeStart="1", writeType="coil"] | |
| Thing data i3 "Стан 3" [ readStart="2", readValueType="bit", writeStart="2", writeType="coil"] | |
| Thing data i4 "Стан 4" [ readStart="3", readValueType="bit", writeStart="3", writeType="coil"] | |
| Thing data i5 "Стан 5" [ readStart="4", readValueType="bit", writeStart="4", writeType="coil"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let proxy = require('openhab-proxy-pattern'); | |
| /* | |
| proxy.bind(proxy_item_name, hardware_item_name).update([callback]).forward([callback]); | |
| */ | |
| // проксирование от железа в виртуалку | |
| proxy.bind('Equipment_WF_OutTemperature', 'SmartMAC_D105_1_T2').update(); | |
| // проксирование в обе стороны |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let proxy = require('openhab-proxy-pattern'); | |
| proxy.bind("GF_Office_Co2", "Netatmo_Indoor_Co2") | |
| .update(function(value) { | |
| const ppm = parseInt(value); | |
| return (typeof value == 'string') ? `${ppm} ppm` : undefined; | |
| }); | |
| proxy.bind("GF_Office_Humidity", "Netatmo_Indoor_Humidity") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Number Netatmo_Indoor_Humidex "Humidex [%.0f]" <temperature_hot> {channel="netatmo:NAMain:home:inside:Humidex", expire="60m" } | |
| Number:Temperature Netatmo_Indoor_HeatIndex "HeatIndex [%.1f %unit%]" <temperature_hot> {channel = "netatmo:NAMain:home:inside:HeatIndex", expire="60m" } | |
| Number:Temperature Netatmo_Indoor_Dewpoint "Dewpoint [%.1f %unit%]" <temperature_cold> {channel = "netatmo:NAMain:home:inside:Dewpoint", expire="60m" } | |
| Number:Temperature Netatmo_Indoor_DewpointDepression "DewpointDepression [%.1f %unit%]" <temperature_cold> {channel = "netatmo:NAMain:home:inside:DewpointDepression", expire="60m"} | |
| Number:Dimensionless Netatmo_Indoor_Co2 "Co2 [%d %unit%]" <carbondioxide> {channel = "netatmo:NAMain:home:inside:Co2", expire="60m"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /////////////////////// | |
| // Кабінет | |
| Group GF_Office "Кабінет" <office> (Home_GroundFloor) ["Office"] | |
| Group GF_Office_HVAC "Клімат кабінету" <heating> (GF_Office, gHVAC) ["HVAC"] {ga="Thermostat" [ modes="heat,eco=ECO,auto" ]} | |
| Number:Temperature GF_Office_Temperature "Температура у кабінеті [%.1f %unit%]" <hvac_temperature> (GF_Office_HVAC, gTemperature) ["Measurement", "Temperature"] {ga="thermostatTemperatureAmbient"} | |
| Number:Temperature GF_Office_SetpointTemperature "Бажана температура у кабінеті [%.1f %unit%]" <hvac_setpoint> (GF_Office_HVAC, gSetpointTemperature) ["Setpoint", "Temperature"] {ga="thermostatTemperatureSetpoint"} | |
| Number:Dimensionless GF_Office_Humidity "Вологість у кабінеті [%d %%]" <hvac_humidity> (GF_Office_HVAC) ["Measurement", "Humidity"] {ga="thermostatHumidityAmbient"} | |
| Number:Dimensionless GF_Office_Co2 "Co2 у кабінеті [%d ppm]" <hvac_co2> (GF_Office_HVAC) ["Measurement", "CO2"] { ga="Sensor" [ sensorName="CarbonDioxideLevel", valueUnit="PARTS_PER_MILLION" ] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir /app/nano | |
| curl https://github.com/Ehryk/heroku-nano/raw/master/heroku-nano-2.5.1/nano.tar.gz --location --silent | tar xz -C /app/nano | |
| export PATH=$PATH:/app/nano |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define AC_PIN 3 | |
| #define RF_PIN 2 | |
| #define LED_PIN 13 | |
| volatile int counter = 0; | |
| volatile int ac_status = 0; | |
| volatile unsigned long ac_timer; | |
| int ON[] = {2, 2, 2, 2, 1, 4, 4, 4, 4, 5, 1, 4, 4, 4, 4, 4, 4, 5, 2, 2, 1, 4, 4, 4, 6}; //The RF code that will turn the ON | |
| int OFF[] = {2, 2, 2, 2, 1, 4, 4, 4, 4, 5, 1, 4, 4, 4, 4, 4, 4, 5, 2, 2, 2, 2, 2, 2, 3}; //The RF code that will turn the OFF |