• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Daniele
    3. Best
    D
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 19
    • Posts 110
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: MyController 1.2.0-SNAPSHOT version with major provider changes and supports for ack

      @jkandasa Actually without going in edit you don't have anything telling you if this GW uses ack. Enabled / disabled would be enough for me.

      posted in Announcements
      D
      Daniele
    • RE: Your suggestions to choose naming for "sensor" and "variable"

      @jkandasa Maybe I misunderstood the meaning of this class, but what about "message" instead of "field"?

      posted in General Discussion
      D
      Daniele
    • RE: How to receive a notification when a message has no Ack

      Done! 494

      posted in Developers Zone
      D
      Daniele
    • RE: MyController 1.2.0-SNAPSHOT version with major provider changes and supports for ack

      You're super-quick!!!

      I updated the version, and now the issue is fixed.
      For the time being everything is running fine, I'll let it run for a pair of days and let you know if I find any issue.

      By the way, I suggest adding something in this page to expose the ack flag status:

      0_1518011160598_a2327e09-f2e9-4c5c-acca-cb03f5b15b37-image.png

      posted in Announcements
      D
      Daniele
    • RE: Your suggestions to choose naming for "sensor" and "variable"

      @skywatch source and value looks very good to me!

      posted in General Discussion
      D
      Daniele
    • RE: automatic backup

      I can confirm that with 23 hours the scheduler works perfectly now!
      Thanks a lot!

      posted in Troubleshooting
      D
      Daniele
    • RE: V_HVAC_FLOW_STATE issue

      Works perfectly!
      You rock!

      posted in Developers Zone
      D
      Daniele
    • RE: automatic backup

      Now that's clear, I'll try using 23 hours.
      Thanks!

      posted in Troubleshooting
      D
      Daniele
    • RE: notification on node down status

      @jkandasa I managed to get the result using a slightly different approach. I saved previous node state in a repository variable, then looped over the nodes list and compared actual state with previous one, sending en email only when state changes.

      I'm not a java programmer, so any suggestion on the code is more than welcome:

      var myImports = new JavaImporter(java.io, java.lang, java.util,java.lang.Object, org.mycontroller.standalone.utils.McUtils);
      
      with(myImports) {
      	var options = new HashMap();
      	options.put("orderBy", "Eui");
      	options.put("order", "asc");
      	options.put("pageLimit", new Long(-1)); // -1 to list all the nodes
      
      	var nodes = mcApi.node().getAll(options);
      
      	var nodesVar = mcApi.variable().get("Nodes state");
      	var nodesOU = JSON.parse(nodesVar.value);
      	var nodesOD = JSON.parse(nodesVar.value2);
      
      	var nodesU = [];
      	var nodesD = [];
      
      	var subject = "[MyController] Nodes status";
      	var messageU2D = "";
      	var messageD2U = "";
      	var message = "";
      
      	for (i = 0; i < nodes.data.length; i++) {
      
      		var nodeStatus = new Object();
      		nodeStatus['key']   = nodes.data[i].getGatewayTable().getId() + '-' + nodes.data[i].getEui();
      		nodeStatus['state'] = nodes.data[i].getState();
      
      		if (nodeStatus['state'] == "UP") {
      			nodesU.push(nodeStatus['key']);
      			var prevState = "";
      			for (j = 0; j < nodesOU.length; j++){
      				if (nodesOU[j] == nodeStatus['key']) prevState = "UP";
      			}
      			if (prevState != "UP")
      				messageD2U += nodes.data[i].getEui() + " : " + nodes.data[i].getName() + " : " + mcApi.utils().friendlyTime(nodes.data[i].getLastSeen()) + "<BR>";
      		}
      
      		if (nodeStatus['state'] == "DOWN") {
      			nodesD.push(nodeStatus['key']);
      			var prevState = "";
      			for (j = 0; j < nodesOD.length; j++){
      				if (nodesOD[j] == nodeStatus['key']) prevState = "DOWN";
      			}
      			if (prevState != "DOWN")
      				messageU2D += nodes.data[i].getEui() + " : " + nodes.data[i].getName() + " : " + mcApi.utils().friendlyTime(nodes.data[i].getLastSeen()) + "<BR>";
      		}
      
      	}
      
      	if (messageU2D != ""){
      		message += "Nodes DOWN: <BR>";
      		message += messageU2D;		
      	}
      
      	if (messageD2U != ""){
      		message += "Nodes UP: <BR>";
      		message += messageD2U;		
      	}
      	
      	if (message != "")
      		//  mcApi.operation().sendPushbulletNote(null, "abc@xyz.com", null, subject, message);
      		mcApi.operation().sendEmail("abc@xyz.com", subject, message);
      
      	nodesVar.value = JSON.stringify(nodesU);
      	nodesVar.value2 = JSON.stringify(nodesD);
      	nodesVar.save();
      }
      
      posted in Developers Zone
      D
      Daniele
    • RE: Unique index or primary key violation: "CONSTRAINT_4B_INDEX_4 ON PUBLIC.METRICS_DOUBLE_TYPE_DEVICE

      @jkandasa it's probably related to some gateway issue, probably connected to the issue I asked here

      I made a hard restart of the gateway and now the error disappeared.
      Thank you!

      posted in Troubleshooting
      D
      Daniele
    • RE: Communication between 2 pi each running mycontroller

      @skywatch you could probably exchange messages thru MQTT queues, but being you I'd really invest my energies understanding how to use 2 gateways, since this is the standard way and you'll probably get more support for the community.
      By the way, I have 4 gateways in my home (due to connectivity issue caused by concrete walls) and I never had issues with that in MyController.

      posted in Developers Zone
      D
      Daniele
    • RE: Frequent errors related to Ethernet Gateways

      @jkandasa I restart MyController Raspberry regularly (scheduled once per week), I tried doing that manually but nothing changed.
      No changes on the router, but you made me remember I recently re-uploaded the sketches of my gateways and in this way I upgraded their mysensors library version.
      I'll try downgrade one of them and see if this helps.

      posted in Troubleshooting
      D
      Daniele