Home central heating monitor/controller

7 years 2 months ago - 7 years 2 months ago #3696 by bmwmilos
Today I decided to try and open new account and do everything from scratch and voila :

Please Log in or Create an account to join the conversation.

7 years 2 months ago - 7 years 2 months ago #3697 by bmwmilos
So it seems I did something wrong in my other account and even though I deleted all of the modules and module groups,something remained and causes a problem.
Now the module is working ok and it would be great if it would be added to the app.
The module code is:
function getModuleData(module){
var data = {
    icon: "",
    status: "",
    timestamp: "",
    rawvalue: "",
    unit: "",
    rawvalue1: ""
};
data.icon = "user/" + Eiot.Data.ProfileId + "/images/dimmer.png";
var ic = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Settings.Icon1");
if (ic != null && ic != "" && ic != "undefined")
  	data.icon = "user/" + Eiot.Data.ProfileId + "/images/" + ic.Value;
var level = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Sensor.Parameter1");
if (level != null) {
   data.unit = level.Unit;
	data.timestamp = level.Timestamp;
   data.rawvalue = level.Value;
   var value = Math.round(level.Value.replace(",", ".") * 100) / 100;
   if (isNaN(value)) value = level.Value;
	data.status = data.status + ((level.Description == "") ? "" : level.Description + ": ")  + value + ((level.Unit == "") ? "" : "&nbsp;" + level.Unit)+ "<br>";
}
var level1 = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Sensor.Parameter2");
if (level1 != null) {
	data.rawvalue1 = level1.Value;
	if (data.timestamp < level1.Timestamp)
		data.timestamp = level1.Timestamp;
	var offText = "OFF";
	var o1 = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Settings.StatusText2");
	if (o1 != null)
		offText = o1.Value;
	var level = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Sensor.Parameter2");
	if (!(level != null && level.Value == "1")) 
		data.status = offText+ "<br>";
}
if (module.Parameters != null) {
       if (module.Parameters.length > 2)
	for (var p = 2; p < module.Parameters.length; p++) {
		if (module.Parameters[p].Name.substring(0, 7) == "Sensor.") {
			data.status = data.status + ((module.Parameters[p].Description == "") ? module.Parameters[p].Name : module.Parameters[p].Description) + ": " + module.Parameters[p].Value + ((module.Parameters[p].Unit == "") ? "" : "&nbsp;" + module.Parameters[p].Unit) + "<br>";
			if (data.timestamp < module.Parameters[p].Timestamp)
				data.timestamp = module.Parameters[p].Timestamp;
		}
	  }
}
return data;
}
Well,this is only function getModuleData but the rest is ok.

Please Log in or Create an account to join the conversation.

7 years 2 months ago #3698 by EasyIoT

bmwmilos wrote: So it seems I did something wrong in my other account and even though I deleted all of the modules and module groups,something remained and causes a problem.
Now the module is working ok and it would be great if it would be added to the app.
The module code is:

function getModuleData(module){
var data = {
    icon: "",
    status: "",
    timestamp: "",
    rawvalue: "",
    unit: "",
    rawvalue1: ""
};
data.icon = "user/" + Eiot.Data.ProfileId + "/images/dimmer.png";
var ic = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Settings.Icon1");
if (ic != null && ic != "" && ic != "undefined")
  	data.icon = "user/" + Eiot.Data.ProfileId + "/images/" + ic.Value;
var level = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Sensor.Parameter1");
if (level != null) {
   data.unit = level.Unit;
	data.timestamp = level.Timestamp;
   data.rawvalue = level.Value;
   var value = Math.round(level.Value.replace(",", ".") * 100) / 100;
   if (isNaN(value)) value = level.Value;
	data.status = data.status + ((level.Description == "") ? "" : level.Description + ": ")  + value + ((level.Unit == "") ? "" : "&nbsp;" + level.Unit)+ "<br>";
}
var level1 = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Sensor.Parameter2");
if (level1 != null) {
	data.rawvalue1 = level1.Value;
	if (data.timestamp < level1.Timestamp)
		data.timestamp = level1.Timestamp;
	var offText = "OFF";
	var o1 = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Settings.StatusText2");
	if (o1 != null)
		offText = o1.Value;
	var level = Eiot.WebApp.Utility.GetModulePropertyByName(module, "Sensor.Parameter2");
	if (!(level != null && level.Value == "1")) 
		data.status = offText+ "<br>";
}
if (module.Parameters != null) {
       if (module.Parameters.length > 2)
	for (var p = 2; p < module.Parameters.length; p++) {
		if (module.Parameters[p].Name.substring(0, 7) == "Sensor.") {
			data.status = data.status + ((module.Parameters[p].Description == "") ? module.Parameters[p].Name : module.Parameters[p].Description) + ": " + module.Parameters[p].Value + ((module.Parameters[p].Unit == "") ? "" : "&nbsp;" + module.Parameters[p].Unit) + "<br>";
			if (data.timestamp < module.Parameters[p].Timestamp)
				data.timestamp = module.Parameters[p].Timestamp;
		}
	  }
}
return data;
}
Well,this is only function getModuleData but the rest is ok.


Hi, we will add this to next release. We also working on new Android/iOS/Windows mobile app. and this will be included.

Please Log in or Create an account to join the conversation.

7 years 2 months ago #3701 by bmwmilos
I am waiting eagerly for the new app.

Please Log in or Create an account to join the conversation.

7 years 2 months ago #3707 by EasyIoT

bmwmilos wrote: I am waiting eagerly for the new app.


Android app. was completely redesigned, because we are building app for all platforms (Android, iOS and Windows). Right now app. is not release ready, but we can prepare .apk for test before release. I will let you now when it will be ready for testing.

Please Log in or Create an account to join the conversation.

7 years 2 months ago #3708 by bmwmilos
Ok. Thanks. I will gladly assist in testing.

Please Log in or Create an account to join the conversation.

Time to create page: 0.250 seconds

Forum latest

  • No posts to display.