• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Anduril
    3. Topics
    A
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 22
    • Groups 0

    Topics

    • A

      set a time delay in java operation

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      4
      0 Votes
      4 Posts
      314 Views
      jkandasaJ
      @Anduril said in set a time delay in java operation: Another minor question: I added Names to my sensors (which were auto-detected during node presentation if that matters), but they get overwritten with for example 74522 TSF:MSG:READ,17-17-0,s=22,c=0,t=23,pt=0,l=0,sg=1: which seems to be the complete serial incoming message for that sensor. Is this know and is there a way to avoid this name-changing? Yes, we have an option to lock the name. Add this property on your node. "lockNode": true For more detail have a look at https://github.com/mycontroller-org/mycontroller/issues/464
    • A

      assign value on user confirmation (button click)

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      2
      0 Votes
      2 Posts
      457 Views
      jkandasaJ
      @anduril There is no direct option available to archive this setup. However, we have a workaround. Create a virtual node/sensor - Binary sensor (will give switch type) Add your virtual button(virtual sensor) to the dashboard Create an operation to execute a script Implement two rules that should trigger script operation when there is a change in the button If you want to control based on switch ON/OFF state, just read this switch state on your script. Screenshots: Operation to execute script: [image: 1525356583895-d79b2213-c1df-490c-877f-107f47f3a54b-image-resized.png] A rule for switch ON state: [image: 1525356347506-161a4013-9614-47e0-be21-7b31a2c0b87c-image-resized.png] A rule for switch OFF state: [image: 1525356373037-0461c12d-a04f-4c80-8d04-9408e13a7944-image-resized.png] Virtual switch on dashboard: [image: 1525356600592-ea7aa4a3-2d68-4991-b323-734fbe3877db-image.png]
    • A

      possible to read xml file in custom widget?

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      16
      0 Votes
      16 Posts
      2k Views
      jkandasaJ
      @anduril I have removed the old method readXmlByXpath. Introduced XmlApi class to address xml stuff. mcApi.xml().read(uri, xpath) - Returns String uri - can be local disk path or http url xpath - should be a valid xpath mcApi.xml().readAsList(uri, xpath) - Returns List<Map<String, String>> uri - can be local disk path or http url xpath - should be a valid xpath mcApi.xml().update(uri, xpath, value) uri - should be local disk path xpath - should be a valid xpath value - String value will be replaced on xpath Is it also possible to update the values in the xml file? I don't mean adding new nodes or other fancy stuff, only updating for example /student/details/class from Three to Four. Yes, now it is possible with, mcApi.xml().update("/tmp/file-xml-demo.xml", "/student/details[1]/class", "Four"); As far as I read the xpath is just a pointer in the tree of an xml, so there is no option to manipulate items. Maybe there is another function available to do this. You can call readAsList, var list = mcApi.xml().readAsList("/tmp/file-xml-demo.xml", "//id[text()='4']/.."); // get first result var item = list.get(0); // get name, id, class item.get("name"); item.get("id"); item.get("class");
    • A

      How to use custome widget

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      10
      0 Votes
      10 Posts
      2k Views
      jkandasaJ
      @anduril There is no direct options available. Let me have a look and update you
    • A

      How to show several sensor readings in a single widget

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      4
      0 Votes
      4 Posts
      2k Views
      jkandasaJ
      @Anduril You have to create UidTag for required variables, For example. If you want to show outside temperature, humidity and precipitation. Create UidTag for all these variables as follows, outside-temperature >> for outside temperature humidity >> for Humidity precipitation >> to show precipitation Note: Creat UidTag for the above value. Script: var myImports = new JavaImporter(java.io, java.lang, java.util, java.text); with(myImports) { var temperature= mcApi.uidTag().getByUid("outside-temperature").getResource(); var humidity= mcApi.uidTag().getByUid("humidity").getResource(); var precipitation= mcApi.uidTag().getByUid("precipitation").getResource(); } Now create an HTML template to show these values, <div>Outside temperature: ${temperature.value}°C</div> <div>Humidity: ${humidity.value}%</div> <div>${precipitation.value}mm precipitation during the last 24h</div> Use this script and template on dashboard custom widget.