Folks may find this interesting and useful
Uses Hubitat Elevation MakerAPI
Grabs all device details periodically of when poked from Hubitat Elevation
As an aside I would really like a Rule Machine trate limiting option. I manage this currently as shown above with a cancelable timer. Does anyone have a better idea?
Also how about allowing a response from an HTTP request to be assigned to a variable in RM.
var msg1 = {};
var devs = [];
var a = {};
var obj = {};
var names = [];
var values = [];
for(j = 0;j < msg.payload.length;j++)
{
var label = msg.payload[j].label;
var name = msg.payload[j].name;
var id = msg.payload[j].id;
a = msg.payload[j].attributes;
var dev = {};
dev.id = id;
dev.label = label;
dev.name = name;
dev.attributes = a;
devs.push( dev );
}
msg1.payload = devs;
return msg1;
Then a function for each device for selecting data
var msg1 = {};
var devicelabel = "Outside Heat Index";
msg1.topic = devicelabel;
var obj = {};
var names = [];
var values = [];
for(j = 0;j < msg.payload.length;j++)
{
//node.warn( msg.payload[j]);
if( msg.payload[j].label == devicelabel)
{
obj = msg.payload[j];
var a = obj.attributes;
for(i = 0;i < a.length;i++)
{
var val = a[i];
obj[val.name] = (val.currentValue == 999 ? 0 : val.currentValue);
}
msg1.payload = obj.attributes;
msg1.payload.devicelabel = devicelabel;
break;
}
}
return msg1;
I have a Hubitat Elevation Hub with a mix of Shelly plus various other Arduino, Zigbee Xiaomi and Sonoff devices. No Zwave so far, quite a few polled LAN based Arduino and Shelly devs.