So, i worked myself into the Plugin, got it working also with the automatic Broker switching if one is not reachable. Now i want to pack all attributes of my device into one JSON String. I get it to work with the actual changed values but how can i send all values from the attributes of my device?
This is my actual Code to send the Values:
function onChangeRequest(device, attribute, value) {
switch (device.Id) {
case "1":
mqtt.publish("/AstoriaTest/ok", "{" + "\"deviceId\":\"" + device.Id + "\"," + "\"attr\":\"" + attribute + "\"," + "\"value\":\"" + value + "\"}");
break;
}
}
In your MQTT Example you used
$HomeRemote.Attribute.Value
But that doesn´t seem to work in the JS Plugin, as it says “$HomeRemote not found”
Thanks
CrunkFX