{{# we may be built from a status update, so the device is passed to us through the query}} {{if d==null}} {{d=device_by_ref queries['ref']}} {{end}}