I use the network binding to monitor a bunch of nodeMCU/tasmota devices for up/down, and I’d like to be able to have a template in HABPanel to click on them to bring me to the device.
I have an item defined like this using .items files: Switch Z_iot_barn_av_online "Tasmota Barn AV" <online> (gMonitored) { channel="network:pingdevice:iot_barn_av:online" [url="http://192.168.6.143"]}
and I was hoping a template would be as simple as this:
Not without forking HABPanel, then you can modify the /rest/items call to include the metadata namespaces you need.
If you don’t need them anywhere else though, and yes it’s ugly, but you can hardcode an object with the URLs with ng-init and use that:
<div ng-init="urls = {
Z_iot_barn_av_online: 'http://192.168.6.143',
Another_Item: 'http://192.168.6.144,
}"> <!-- ^^ add to the above as necessary -->
<div class="row" ng-repeat="item in itemsInGroup('gMonitored')">
<div class="col-xs-8 text-right">{{item.label}}: {{urls[item.name]}}</div>
<div class="col-xs-4 text-left" ng-style="{ color: itemState(item.name)=='ON'?'green':'red' }">
{{itemState(item.name)}}
</div>
</div>
</div>