Plugin efficiency/performance

Hi,

As I’m going to develop some plugin implementing WIAB (wasp in a box) model I’d like to know which approach will be more efficient:

  1. Single device that holds self configuration (check intervals, etc.) and configuration of zones (IDs of rooms/sensors) in some format
  2. Main device holding self configuration (check intervals) + child devices, each holding configuration of one zone (room ID + IDs of door/move sensors in this room)

The second approach seems to be a bit nicer for user (possibility of adding another zone with click of a button, separate view of each zone, etc.).
I’m just curious if it will have any influence on amount of cpu/memory used, f.ex. will there be a big difference between:

  • main device with 2 child devices and
  • main device with 10 child devices
    assuming that child devices are devices of the same type.

Thanks for your answers and any tips in that matter.

Sorry can’t answer your question but I am very interested in the idea of a wiab plugin. I use some pretty complex pleg to do it now, but would be great to have something that gives room occupancy in a nice easy way. Care to share how you plan to implement it?

Cheers

Not sure about details yet. Currently I’m reading about other’s approach to the problem and trying to get it into one simple solution.

Child devices don’t tend to chew up resources. Memory usage seems to be proportional to the number of Luup threads you have, and child devices use their parent’s thread (if you’ve turned on the “handle children” flag, which practically every developer does).

The parent device will need to have at least a list of all the children so it can enumerate them in a luup.chdev loop. It’s been my experience that since you have to keep that list on the parent device, you may as well store everything else there too.

Thanks for the info :slight_smile: