Flexible Wireless Sensor Network for smart lighting applications