<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with custom widget]]></title><description><![CDATA[A list of topics that have been tagged with custom widget]]></description><link>http://forum.mycontroller.org/tags/custom widget</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Nov 2026 22:48:10 GMT</lastBuildDate><atom:link href="http://forum.mycontroller.org/tags/custom widget.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[Custom widget - dynamic images on dashboard]]></title><description><![CDATA[<p dir="auto">There is a request on <a href="https://github.com/mycontroller-org/mycontroller/issues/405" rel="nofollow ugc">https://github.com/mycontroller-org/mycontroller/issues/405</a> to show dynamic images on dashboard.</p>
<p dir="auto">We can achieve this by using the custom widget.</p>
<p dir="auto">Create an HTML template as follows, replace this url with your actual URL.</p>
<pre><code class="language-html">&lt;div&gt;
    &lt;img  ng-src="https://static.pexels.com/photos/2487${dynamicImage}/pexels-photo-2487${dynamicImage}.jpeg" alt="test image" class="adf-myc-dsi-image"/&gt;
&lt;/div&gt;
</code></pre>
<p dir="auto">Create a javascript as follows, Use UIDTag to map your <code>Custom</code> &gt;&gt; <code>VAR1</code> senor variable</p>
<pre><code class="language-javascript">var myImports = new JavaImporter(java.io, java.lang, java.util, java.text);

with(myImports) {
  //var dynamicImage = mcApi.uidTag().getByUid("image-var1").getResource();
  var dynamicImage = 98;
}
</code></pre>
<p dir="auto">Add your HTML template and script on dashboard with custom widget,<br />
<img src="https://user-images.githubusercontent.com/1004403/31325413-7e808538-acda-11e7-9513-56d39ecfd516.png" alt="image" class=" img-fluid img-markdown" /></p>
]]></description><link>http://forum.mycontroller.org/topic/201/custom-widget-dynamic-images-on-dashboard</link><guid isPermaLink="true">http://forum.mycontroller.org/topic/201/custom-widget-dynamic-images-on-dashboard</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[RGB Controller]]></title><description><![CDATA[Thanks for the reply - a winter project I think 
]]></description><link>http://forum.mycontroller.org/topic/188/rgb-controller</link><guid isPermaLink="true">http://forum.mycontroller.org/topic/188/rgb-controller</guid><dc:creator><![CDATA[skywatch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Hour Meter]]></title><description><![CDATA[@daniele You may need to create a dummy sensor and update sensor value everyday night via a script.
]]></description><link>http://forum.mycontroller.org/topic/139/hour-meter</link><guid isPermaLink="true">http://forum.mycontroller.org/topic/139/hour-meter</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Send Payload but NACK]]></title><description><![CDATA[@jkandasa
OHHHH wonderfull !!! I will try this !
Many thanks !
]]></description><link>http://forum.mycontroller.org/topic/128/send-payload-but-nack</link><guid isPermaLink="true">http://forum.mycontroller.org/topic/128/send-payload-but-nack</guid><dc:creator><![CDATA[Tetnobic]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Display text based on sensor value, is that possible?]]></title><description><![CDATA[@jkandasa
Just tested and it works like a charm!!!
Really great examples, that are easy to implement.
Mycontroller was already great, now it is even better!!.
Thank you!!
]]></description><link>http://forum.mycontroller.org/topic/124/display-text-based-on-sensor-value-is-that-possible</link><guid isPermaLink="true">http://forum.mycontroller.org/topic/124/display-text-based-on-sensor-value-is-that-possible</guid><dc:creator><![CDATA[Tag]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Monitoring electricity consumption]]></title><description><![CDATA[@rjad

Ok,I tested this but couldn't get it to work. Presumably I didn't follow the instructions properly.

When you do changes on HTML additional headers, you have to reload the browser. I hope you did this.

With some work it could be better, so for example, I lose the hover information, I had trouble getting two of these plots on one dashboard with different bins.

For hover information, I do nit get any clue. As I never worked directly with the D3 chart.
For the multiple of charts on same dashboard issue, you might have chart id issue.
Maybe because of this one,
 &lt;canvas id="simpled3" style="display: none;"&gt;&lt;/canvas&gt;

]]></description><link>http://forum.mycontroller.org/topic/85/monitoring-electricity-consumption</link><guid isPermaLink="true">http://forum.mycontroller.org/topic/85/monitoring-electricity-consumption</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Control&#x2F;display operations via script]]></title><description><![CDATA[<h4>To list operations on Dashboard.</h4>
<h5>Script: <code>JavaScript</code></h5>
<pre><code>var myImports = new JavaImporter(java.io, java.lang, java.util);

with(myImports) {
  var filters = new HashMap();
  filters.put("orderBy", "name");
  filters.put("order", "asc");
  filters.put("pageLimit", new Long(10));
  //Get operations data
  var operations = mcApi.operation().getAll(filters);
}
</code></pre>
<h5>Template:</h5>
<pre><code>&lt;table class="table table-hover table-bordered table-striped mc-table"&gt;
  &lt;thead&gt;
    &lt;th&gt;{{ 'STATUS' | translate }}&lt;/th&gt;
    &lt;th&gt;{{ 'ID' | translate }}&lt;/th&gt;
    &lt;th&gt;{{ 'NAME' | translate }}&lt;/th&gt;
    &lt;th&gt;{{ 'OPERATION' | translate }}&lt;/th&gt;
    &lt;th&gt;{{ 'LAST_EXECUTION' | translate }}&lt;/th&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;#list operations.data as item&gt;
      &lt;tr ui-sref="operationsAddEdit({id: ${item.id} })"&gt;
        &lt;td class="text-center"&gt;
          &lt;#if item.enabled&gt;
            &lt;i class="text-success fa fa-circle fa-lg" uib-tooltip="{{ 'ENABLED' | translate }}"&gt;&lt;/i&gt;
          &lt;#else&gt;
            &lt;i class="text-danger fa fa-circle-o fa-lg" uib-tooltip="{{ 'DISABLED' | translate }}"&gt;&lt;/i&gt;
          &lt;/#if&gt;
        &lt;/td&gt;
        &lt;td&gt;${item.id}&lt;/td&gt;
        &lt;td&gt;${(item.name)!}&lt;/td&gt;
        &lt;td ng-bind-html="'${(item.operationString)!}' | mcResourceRepresentation"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;span uib-tooltip="{{ ${(item.lastExecution?c)!"Never"} | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="${(item.lastExecution?c)!"Never"}"&gt;&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/#list&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>
<h4>To enable/disable list of operations:</h4>
<h5>JavaScript</h5>
<p dir="auto"><strong>Script bindings:</strong> <code>{options:{name:"operation-name", enable:false}}</code><br />
<strong>Important</strong>: It is important to pass <code>Script bindings</code> when executing this script. In the binding you can include your operation <code>name</code> to filter. Please note in Mycontroller all filters are working with case sensitive. In the name filed you can put any words where operation name contains.</p>
<p dir="auto">For example I want to enable or disable following operations,</p>
<ul>
<li><code>my send email notification operation</code></li>
<li><code>notification: pushbullet</code></li>
</ul>
<p dir="auto">In the above names I have <code>notification</code> word in common. So I can use this name in filter to get these operations exactly.</p>
<h6>To disable:</h6>
<p dir="auto"><code>{options:{name:"notification", enable:false}}</code></p>
<h6>To enable:</h6>
<p dir="auto"><code>{options:{name:"notification", enable:true}}</code></p>
<pre><code>var myImports = new JavaImporter(java.io, java.lang, java.util);

with(myImports) {
  var filters = new HashMap();
  var names = new ArrayList();
  names.add(options.name);

  filters.put("orderBy", "name");
  filters.put("order", "asc");
  filters.put("pageLimit", new Long(10));
  filters.put("name", names)

  //Get operations data
  var operations = mcApi.operation().getAll(filters);
  
  var operationIds = new ArrayList();
  for(var count =0 ; count&lt;operations.data.length;count++){
    //You can do some filter here
     operationIds.add(operations.data[count].id);
  }
  
  if(options.enable){
   mcApi.operation().enableIds(operationIds);
  }else{
   mcApi.operation().disableIds(operationIds);
  }
}
</code></pre>
<p dir="auto"><strong>SOURCE:</strong> refer <a href="https://github.com/mycontroller-org/mycontroller/issues/235" rel="nofollow ugc">this issue</a> for complete details.</p>
]]></description><link>http://forum.mycontroller.org/topic/46/control-display-operations-via-script</link><guid isPermaLink="true">http://forum.mycontroller.org/topic/46/control-display-operations-via-script</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Custom widget]]></title><description><![CDATA[@fsgrazzutti Great catch! Thanks.
]]></description><link>http://forum.mycontroller.org/topic/37/custom-widget</link><guid isPermaLink="true">http://forum.mycontroller.org/topic/37/custom-widget</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>