22 Commits
Author SHA1 Message Date
BlubbFish 17ba628d0b Update .gitignore remove Release 2019-02-12 18:17:11 +01:00
BlubbFish a7fe9d7279 [NF] Change dependencys 2018-10-29 21:59:06 +00:00
BlubbFish b5e7d81d28 Zway-Bot [v1.7.2] Add Logging to some Modules, fixing a bug in overtaker (now it not removes every time all events, so only the latest event are watched)
[Utils] Fixing a bug if more than one argument with params
2018-10-02 14:53:59 +00:00
BlubbFish 35aadc09cf Zway-Bot [v1.7.1] Tiny fix for nullpointer exception 2018-09-29 18:13:17 +00:00
BlubbFish af7eeeaf15 Zway [v1.5.0] Throw Exception if 3 times failed to connect to Raspberry server, add 3 new commandlcasses to IgnoredClasses
Zway-Bot [v1.7.0] rewrite to Threaded Modules, edit service file for systemd
2018-09-29 12:15:37 +00:00
BlubbFish c47895e6bb Add new Class and throw on exeption 2018-08-02 21:42:26 +00:00
BlubbFish 3a19253230 [NF] Moved CronJob, Overtaker, Statuspolling to Abstract Bot-Utils
[NF] Create NSI Script to produce exe
[NF] Add License.txt
2018-06-09 21:27:15 +00:00
BlubbFish 58f467a591 [NF] Add Bot-Utils and rewrite code 2018-06-07 20:49:54 +00:00
BlubbFish 52bb4bcea7 [NF] Thread that checks if a MQTT Connection exists and if not reopen it
[NF] ConnectorDataMqtt now supports user and password
2018-06-05 16:46:56 +00:00
BlubbFish 3760f36e9f [BF] new try 2018-06-02 19:38:56 +00:00
BlubbFish 05cbcdf2dc [BF] new try 2018-06-02 19:36:32 +00:00
BlubbFish dd4cc7635c [BF] new try 2018-06-02 19:32:20 +00:00
BlubbFish bf49abfd44 [BF] Fixing Bug in after installation script 2018-06-02 19:08:05 +00:00
BlubbFish 566f840012 [BF] Making service linux running 2018-06-02 18:41:21 +00:00
BlubbFish d1a8fa449b 2018-06-02 17:14:42 +00:00
BlubbFish 1da54f7416 [NF] Logrotate 2018-05-29 20:07:50 +00:00
BlubbFish eb4783c11e 2018-05-29 16:15:17 +00:00
BlubbFish c06d910356 [NF] Now sould dedect Strg+c on Linux 2018-05-15 20:52:54 +00:00
BlubbFish 02871e4d66 [BF] Fixinig installations dpkg script 2018-05-15 19:04:19 +00:00
BlubbFish edb59f01b6 [BF] Fixinig installations dpkg script 2018-05-15 18:59:32 +00:00
BlubbFish ce30132f5f Utils.csproj
[NF] Programmlogger added (v1.1.0)
[NF] Utils fixing tiny issues

Zway-Bot.csproj
[NF] changes Topics without beginning /
[NF] Using programmlogger (v1.4.0)
2018-05-15 18:49:03 +00:00
BlubbFish 64c9020bcb [BF] Fixing Issue with Math.Abs(l) 2018-05-12 12:36:32 +00:00
10 changed files with 68 additions and 25 deletions
+4
View File
@@ -0,0 +1,4 @@
/.vs
/Zway/bin
/Zway/obj
/packages
+11 -3
View File
@@ -31,13 +31,21 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses {
}
private void InitComplex(JsonData json) {
if (json.Keys.Contains("data") && json["data"].Keys.Contains("V1event") &&
json["data"]["V1event"].Keys.Contains("alarmType") && json["data"]["V1event"]["alarmType"].Keys.Contains("value") &&
json["data"]["V1event"].Keys.Contains("level") && json["data"]["V1event"]["level"].Keys.Contains("value")) {
if (json.Keys.Contains("data") && json["data"].Keys.Contains("V1event")) {
if(json["data"]["V1event"].Keys.Contains("alarmType") &&
json["data"]["V1event"]["alarmType"].Keys.Contains("value") &&
json["data"]["V1event"]["alarmType"]["value"] != null &&
json["data"]["V1event"]["alarmType"]["value"].IsInt) {
this.AlarmType = Int32.Parse(json["data"]["V1event"]["alarmType"]["value"].ToString());
}
if(json["data"]["V1event"].Keys.Contains("level") &&
json["data"]["V1event"]["level"].Keys.Contains("value") &&
json["data"]["V1event"]["level"]["value"] != null &&
json["data"]["V1event"]["level"]["value"].IsInt) {
this.Level = Int32.Parse(json["data"]["V1event"]["level"]["value"].ToString());
}
}
}
#endregion
#region ACommandClass
@@ -65,7 +65,7 @@ namespace BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs {
Double l = Double.Parse(json["val"]["value"].ToString());
if (t == "Power" && (l > 3660 || l < 0) ||
t == "Temperature" && (l > 65 || l < -25) ||
(t == "Temperature" && this.Level >= 4 && Math.Abs(l) >= 0.1)) {
(t == "Temperature" && this.Level >= 4 && Math.Abs(l) <= 0.1)) {
return;
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ using LitJson;
namespace BlubbFish.IoT.Zway.Devices {
public class Device {
private Boolean polling;
private readonly Boolean polling;
public delegate void UpdatedDevice(Object sender, DeviceUpdateEvent e);
public event UpdatedDevice Update;
+1 -1
View File
@@ -10,7 +10,7 @@ using LitJson;
namespace BlubbFish.IoT.Zway.Devices {
public class Instance {
private DateTime nextwakeup;
private Boolean polling;
private readonly Boolean polling;
public delegate void UpdatedInstance(Object sender, DeviceUpdateEvent e);
public event UpdatedInstance Update;
+6
View File
@@ -24,22 +24,28 @@ namespace BlubbFish.IoT.Zway.Interfaces {
MeterPulse = 53,
MeterTableMonitor = 61,
ThermostatOperatingState = 66,
ClimateControlSchedule = 70,
CRC16 = 86,
AssociationGroupInformation = 89,
DeviceResetLocally = 90,
ZWavePlusInfo = 94,
MultiChannel = 96,
DoorLock = 98,
BarrierOperator = 102,
ManufacturerSpecific = 114,
PowerLevel = 115,
InclusionController = 116,
Protection = 117,
NodeNaming = 119,
FirmwareUpdate = 122,
Clock = 129,
Association = 133,
Version = 134,
Proprietary = 136,
TimeParameters = 139,
MultiChannelAssociation = 142,
MultiCmd = 143,
SimpleAVControl = 148,
Security = 152
}
+3 -3
View File
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Zway")]
[assembly: AssemblyCopyright("Copyright © 2017 - 03.05.2018")]
[assembly: AssemblyCopyright("Copyright © 2017 - 29.09.2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.2.0")]
[assembly: AssemblyFileVersion("1.4.2.0")]
[assembly: AssemblyVersion("1.5.1")]
[assembly: AssemblyFileVersion("1.5.1")]
+4 -2
View File
@@ -16,7 +16,7 @@ namespace BlubbFish.IoT.Zway {
private Thread updatethread;
private Thread pollthread;
public static ReadOnlyDictionary<String, String> namelist;
private Boolean polling;
private readonly Boolean polling;
public delegate void DataUpdate(Object sender, DeviceUpdateEvent e);
public event DataUpdate Update;
@@ -104,8 +104,10 @@ namespace BlubbFish.IoT.Zway {
CultureInfo.DefaultThreadCurrentUICulture = info;
Thread.CurrentThread.CurrentCulture = info;
Thread.CurrentThread.CurrentUICulture = info;
DateTime lastRequest = DateTime.Now.AddSeconds(-2);
while (true) {
Int64 date = ((DateTimeOffset)DateTime.Now.AddSeconds(-2)).ToUnixTimeSeconds();
Int64 date = ((DateTimeOffset)lastRequest).ToUnixTimeSeconds();
lastRequest = DateTime.Now;
JsonData notifications = this.http.GetJson("ZWave.zway/Data/" + date);
foreach (String item in notifications.Keys) {
Match match = new Regex("^devices\\.([0-9]+)\\.instances\\.([0-9]+)\\.commandClasses\\.([0-9]+)(\\.data\\.([0-9]+)|\\.data\\.[a-z].*|\\.data)$", RegexOptions.IgnoreCase).Match(item);
Binary file not shown.
+33 -10
View File
@@ -6,9 +6,9 @@ using LitJson;
namespace BlubbFish.IoT.Zway.lib {
public class HttpConnection {
private String auth;
private String server;
private Object getLock = new Object();
private readonly String auth;
private readonly String server;
private static readonly Object getLock = new Object();
internal HttpConnection(String server, String user, String pass) {
this.auth = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(user + ":" + pass));
@@ -17,11 +17,23 @@ namespace BlubbFish.IoT.Zway.lib {
}
private void Init() {
this.GetString("ZAutomation/api/v1/status");
this.GetVoid("ZAutomation/api/v1/status");
}
internal JsonData GetJson(String v) {
String text = this.GetString(v);
String text = null;
for (Int32 i = 0; i < 3; i++) {
try {
text = this.GetString(v);
break;
} catch (Exception e) {
Helper.WriteError(e.Message);
if(i==2) {
throw;
}
System.Threading.Thread.Sleep(30000);
}
}
if(text == null) {
return new JsonData();
}
@@ -33,14 +45,25 @@ namespace BlubbFish.IoT.Zway.lib {
}
internal void GetVoid(String v) {
for (Int32 i = 0; i < 3; i++) {
try {
this.GetString(v, false);
break;
} catch (Exception e) {
Helper.WriteError(e.Message);
if (i == 2) {
throw;
}
System.Threading.Thread.Sleep(30000);
}
}
}
private String GetString(String v, Boolean withoutput = true) {
String ret = null;
lock (this.getLock) {
lock (getLock) {
HttpWebRequest request = WebRequest.CreateHttp(this.server + v);
request.Timeout = 5000;
request.Timeout = 10000;
request.Headers.Add(HttpRequestHeader.Authorization, this.auth);
try {
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
@@ -54,9 +77,9 @@ namespace BlubbFish.IoT.Zway.lib {
}
}
} catch (Exception e) {
Helper.WriteError("Konnte keine Verbindung zum Razzbery Server herstellen. Resource: \"" + this.server + v + "\" Fehler: " + e.Message);
return null;
//throw new Exceptions.ConnectionException("Konnte keine Verbindung zum Razzbery Server herstellen: " + e.Message);
//Helper.WriteError("Konnte keine Verbindung zum Razzbery Server herstellen. Resource: \"" + this.server + v + "\" Fehler: " + e.Message);
//return null;
throw new Exceptions.ConnectionException("Konnte keine Verbindung zum Razzbery Server herstellen: " + e.Message);
}
}
return ret;